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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.