Anybody around who already has some experience with pThreads ? I'm interested in implementing a multi threaded socket server...
It is not a hard thing to do. I recently made an implementation in c, it should be much easier in PHP. You basically create, bind, and listen to all new connections and fork a new thread for each request. Look at the following pages then let us know if you need any help. http://php.net/manual/en/ref.sockets.php http://php.net/manual/en/function.pcntl-fork.php You can view a sample demo in C (you can convert the logic to PHP with the above two references): http://www.linuxhowtos.org/C_C++/socket.htm
@ThePHPMaster -- I don't think that's what's being asked... since it's in the PHP section, the OP is probably asking about the actual PHP pThreads object and it's descendents, with it's effectively nonexistent documentation and complete lack of examples anywhere online that I can find on what to do with it.
Thanks for the link. I didn't notice PHP having a future feature to implement Threads. I guess this is a question for the OP, are you building your own PHP or using an existing release. If you want to use the pThreads above, I would suggests you wait until development process on it is complete, once it is implemented into a stable PHP release, it will be documented with examples, I hope.
It's exciting to see that people are starting to get interested in pthreads, I can't wait to see what people write with it.... https://github.com/krakjoe/pthreads/blob/master/examples/SocketServer.php Is an example of a multi-threaded socket server in PHP, I believe, the worlds first ....