I released a version Containing all above Modifications with Ajax/Sockets & TextFiles/MySql
you can get it :
here : http://sourceforge.net/project/showfile ... _id=549135
Or here http://www.phpclasses.org/browse/package/4082.html
Adding Multi-Threading to PHP (Purely New Idea Try it)
Moderator: General Moderators
Re: Adding Multi-Threading to PHP (Purely New Idea Try it)
Hello everybody
it's been around 9 months since the last update to class and finally i got time to it
PHPThreader 1.6 Released
you can get it from sf here : http://sourceforge.net/project/showfile ... _id=203377
or from phpclasses here : http://www.phpclasses.org/browse/package/4082.html
---
The new version has the following features :-
1)Full Online Documentation of class here : http://ajphpth.sourceforge.net [An offline version is provided in sf]
2)new Communication Class : Shared Memory (shmop required )
3)new Thread Calling Class : CliThread (using shell calls) [for whoever asked , it can now run from PHP/Cli
]
4)new Abstract Mutex Class which can be used from user defined Communication Clases .
5)new automatic System of thread watching
6) a simple loader to overcome path issues
7)new methods like Join()
---
hope to hear from you about it
Thanks
it's been around 9 months since the last update to class and finally i got time to it
PHPThreader 1.6 Released
you can get it from sf here : http://sourceforge.net/project/showfile ... _id=203377
or from phpclasses here : http://www.phpclasses.org/browse/package/4082.html
---
The new version has the following features :-
1)Full Online Documentation of class here : http://ajphpth.sourceforge.net [An offline version is provided in sf]
2)new Communication Class : Shared Memory (shmop required )
3)new Thread Calling Class : CliThread (using shell calls) [for whoever asked , it can now run from PHP/Cli
4)new Abstract Mutex Class which can be used from user defined Communication Clases .
5)new automatic System of thread watching
6) a simple loader to overcome path issues
7)new methods like Join()
---
hope to hear from you about it
Thanks
Re: Adding Multi-Threading to PHP (Purely New Idea Try it)
I like the idea because it is thinking outside the box,
the only problem I have with it in theory is that youre launching more httpd threads on the server, and sending more overhead in the http requests. I don't think it would be practical performance wise but it definitely has its applications if you're willing to think out of hte box a little
Some of the best innovators in our history were laughed at when they proposed their ideas initially. I think this could be good where you have a view divided into multiple views, and you need to update different views at different intervals, without reloading the whole display for instance. Didn't download your code but you could also have your "threads" act as persistent servers, so the scripts could create "threads" within javascript as well.
A different idea would be to have a standalone script for your "thread" manager and have it call itself using the "nohup" utility in linux, runing on CLI
nohup is a Unix command that is used to run another command while suppressing the action of the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. It is most often used to run commands in the background as daemons. Output that would normally go to the terminal goes to a file called nohup.out if it has not already been redirected.
You could even have your output redirected somewhere so the main thread can view the status of it's "child" threads
the only problem I have with it in theory is that youre launching more httpd threads on the server, and sending more overhead in the http requests. I don't think it would be practical performance wise but it definitely has its applications if you're willing to think out of hte box a little
Some of the best innovators in our history were laughed at when they proposed their ideas initially. I think this could be good where you have a view divided into multiple views, and you need to update different views at different intervals, without reloading the whole display for instance. Didn't download your code but you could also have your "threads" act as persistent servers, so the scripts could create "threads" within javascript as well.
A different idea would be to have a standalone script for your "thread" manager and have it call itself using the "nohup" utility in linux, runing on CLI
nohup is a Unix command that is used to run another command while suppressing the action of the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. It is most often used to run commands in the background as daemons. Output that would normally go to the terminal goes to a file called nohup.out if it has not already been redirected.
You could even have your output redirected somewhere so the main thread can view the status of it's "child" threads
