Jump to content

Multithreaded socket server


mmmuppet

Recommended Posts

PHP is single threaded.  I've seen hacks to try to make it multithreaded, but none of them were good.

 

 

Go with something like Java or C++ (I like the Boost Thread library, but I haven't used it much).  Or, I hear Python supports multiple threads (I might have dreamed that).

 

 

Edit:  http://php.net/pcntl_fork  I'm not sure quite how that works... I don't know if it's parallel execution or the CPU just alternates.  If it forks into a second process like the manual page says, you might be able to "multithread" with it.  (You would need to share variables though, and I'm not sure if variables are kept.)  I'm about to test it now.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.