Jump to content

Multi-threading


Rojay

Recommended Posts

I may be wrong, but AFAIK PHP doesn't natively support threading.  You can fake the concept though by using exec or system function calls and redirecting the output to /dev/null; this will cause the script to execute in the background and immediately return control to the calling script.

 

After you successfully execute multiple scripts at once, the next step is to allow them to communicate with each other.  Since neither script will have access to the other's memory space, you will need to use disk storage to accomplish cross-script communication.  Note that disk storage is just a general term for files, whether they're text files, database files, etc.

 

Hope that helps you out some.

 

Also, you might try google searching any of the following terms along with PHP:

 

fork, child process, mutex

Link to comment
https://forums.phpfreaks.com/topic/58278-multi-threading/#findComment-288960
Share on other sites

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.