Jump to content

Multi threading


jonsamwell

Recommended Posts

Hi

 

Is it possible to multi thread in php?

 

Basically i have a huge amount of data that would be suite to splitting up into 3/4 threads to increase the speed, the information wouldn't have to be protected (thread safe) so not too difficult.

 

Can php do this?

 

Regards,

 

Jon

Link to comment
Share on other sites

From the manual page linked too....

 

Please see your system's fork(2) man page for specific details as to how fork works on your system.

 

Also, are you planning on running these processes via a server or the command line interface?

Link to comment
Share on other sites

Does it run at the same time as the parent process or just time slices with the parent or stops the parent process altogether?

That all depends on your server. If your running on a multi-core processor, or a mult-processor server, then the threads can run simultaneously, but it's the operating system that determines whether they do so or not.
Link to comment
Share on other sites

As for in-process threads (like posix threads) rather than processes, I'm pretty sure php doesn't support them.

 

We may be able to give some more detailed help if you give us your php version, OS and architecture (eg php 5.2.3 on Windows XP SP2 with Intel E2180).

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.