Investigate use of for real threads (pthreads) #23

Closed
opened 2017-08-15 04:10:17 +00:00 by jamie · 3 comments
jamie commented 2017-08-15 04:10:17 +00:00 (Migrated from git.hazaar.io)

There used to be an old extension that allowed PHP to use pthread. I wouldn't mind having a look at this to see if we can make use of it for handling client connections. That way instead of having a single process handling message communication we can have a thread per client connection to increase performance.

There used to be an old extension that allowed PHP to use pthread. I wouldn't mind having a look at this to see if we can make use of it for handling client connections. That way instead of having a single process handling message communication we can have a thread per client connection to increase performance.
jamie commented 2017-08-15 04:15:54 +00:00 (Migrated from git.hazaar.io)

So:

  • The extension still exists: Yay!
  • However it's limited to the CLI: Ok, well that's fine because Warlock is a CLI app.
  • It requires PHP 7.2+: Hmm, maybe this isn't such a good idea. I don't know of a nice way to support threads and non-threading based on the version. Once we rely on threads we pretty much have to rely on threads.
So: * The extension still exists: Yay! * However it's limited to the CLI: Ok, well that's fine because Warlock is a CLI app. * It requires PHP 7.2+: Hmm, maybe this isn't such a good idea. I don't know of a nice way to support threads and non-threading based on the version. Once we rely on threads we pretty much have to rely on threads.
jamie commented 2017-08-16 04:58:58 +00:00 (Migrated from git.hazaar.io)

Ok. I'm going to close this. Threads in PHP is a pain in the ass. Basically because of ZTS (Zend Thread Safety) this won't work in anything that I use as the PHP distro I use for development is x86-nts (non-thread safe). I have tried getting it up and running but it's got way too much customisation and looks like it might even need a custom build of PHP to work. Bailing on this idea.

Ok. I'm going to close this. Threads in PHP is a pain in the ass. Basically because of ZTS (Zend Thread Safety) this won't work in anything that I use as the PHP distro I use for development is x86-nts (non-thread safe). I have tried getting it up and running but it's got way too much customisation and looks like it might even need a custom build of PHP to work. Bailing on this idea.
jamie commented 2017-08-16 04:58:59 +00:00 (Migrated from git.hazaar.io)

closed

closed
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-warlock#23
No description provided.