Re: [PHP] PHP Threading on Windows

2012-09-14 Thread Joe Watkins

On 14/09/2012 04:42, tamouse mailing lists wrote:

On Thu, Sep 13, 2012 at 9:32 PM, admin ad...@buskirkgraphics.com wrote:

It has been suggested:
 That because php does not support PCNTL threading on Windows that
multiple services of php are an alternative.

I am interested in this theory, if anyone is currently working on a project
that (forks) processes off to another instance or service of PHP on windows
please let me know.
In some of my latest development I have some rather large processes that
consume the single instance of PHP, threading these off would be ideal.

Example:
$tmpsrv=win32_query =win32_create_service(array(
'params' = __FILE__. install,
'service' = 'Name_of_the_service',
'display' = 'Name of service to be displayed in the service list'
));

Any windows php developers have ideas, comments on this suggestion?


I'm interested in the answer to this as well.


https://github.com/krakjoe/pthreads

Windows Download on downloads page, it's a couple of days behind. Keep 
watching ... enough to get you started ...


Sorry if this gets sent twice, the news server or my internet connection 
dropped out ...


Enjoy

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP Threading on Windows

2012-09-14 Thread Joe Watkins

On 14/09/2012 04:42, tamouse mailing lists wrote:

On Thu, Sep 13, 2012 at 9:32 PM, admin ad...@buskirkgraphics.com wrote:

It has been suggested:
 That because php does not support PCNTL threading on Windows that
multiple services of php are an alternative.

I am interested in this theory, if anyone is currently working on a project
that (forks) processes off to another instance or service of PHP on windows
please let me know.
In some of my latest development I have some rather large processes that
consume the single instance of PHP, threading these off would be ideal.

Example:
$tmpsrv=win32_query =win32_create_service(array(
'params' = __FILE__. install,
'service' = 'Name_of_the_service',
'display' = 'Name of service to be displayed in the service list'
));

Any windows php developers have ideas, comments on this suggestion?


I'm interested in the answer to this as well.


https://github.com/krakjoe/pthreads

Windows Download on downloads page, it's a couple of days behind. Keep 
watching ... enough to get you started ...


Sorry if this gets sent twice, the news server or my internet connection 
dropped out ...


Enjoy

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Multithreading for OOP PHP

2012-11-03 Thread Joe Watkins

On 31/10/2012 13:46, Alex Nikitin wrote:

Hey guys (and/or gals),

I have heard this question entirely too many times, I think at some point
Rasmus just stopped responding to it. The real reason that PHP is not
threaded has nothing to do with PHP internal or extension thread safety,
the reason is more to the extent that it doesn't make sense to add
threading to PHP, it will only increase code and model complexity and
create more points of failure, but again the reason is not this, the reason
is that it doesn't make sense in PHP's native environment to add threading
in the first place. Natively PHP is summoned by a web server, yes you can
call PHP in CLI, but that's not it's point market, PHP is first and
foremost a server-side language for the web and it is ran by a web server
such as Apache or Nginx or IIS(i wouldn't know why you would use IIS, but
it could be). All of these web servers (maybe with exception of IIS, i
wouldn't know) work pretty much on the same principal, you have the main
process that spawns a bunch of worker threads (this is adjustable in
configuration, but is typically 1 per cpu thread). These threads are what
actually process the requests and call PHP, meaning that if multiple
threads are processing multiple requests, multiple instances of PHP will be
called. This is why adding threading to PHP makes absolutely no sense, why
would you spawn threads in something that is already being called by a
thread? Don't get me wrong, threads spawning other threads is a solution,
but it is a solution on massively parallel architectures, such as the
GPGPUs that can handle over a thousand threads, and it is a solution for an
entirely different problem, namely costly conditional statements; PHP on
the other hand runs on a general purpose processor that already cache
thrashes and runs into issues with instruction pipelines in parallel
execution, adding more threads to it would do nothing for performance (or
make it worse), make for more complex code and introduce new issues, like
for example how do you test threaded code, debugging, messaging, etc, which
will introduce new places where php apps fail, new security concerns, etc,
and I think we are far from having current issues fixed...

Want to parallelize your PHP execution? Learn to love curl_multi :)

In this case, fix the program, not the programming language. Just my $0.02


-- Alex
--
The trouble with programmers is that you can never tell what a programmer
is doing until it’s too late.  ~Seymour Cray


You're very wrong.

Adding threading doesn't increase complexity at all, the fact is, that 
people are coming up with horrible ways to execute what they should be 
executing in threads. It's 2012, my mobile phone has a dual core 
processor !! All that adding threading does is allow those people 
bending over backwards - using horrible hacks just to do two things at 
once - to do things properly.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php