Jump to content

thread safe vs non thread safe


neginf

Recommended Posts

Hope to have PHP installed on a Windows / IIS computer soon.

Have read that

1.  a non thread safe version should be used,

2.  FastCGI should be used.

 

Is this right ?

Do any precautions need to be made for web programming with a non thread safe version ?

 

Link to comment
Share on other sites

FastCGI is the most appropriate setup for IIS, and due to how CGI works there are not any threads so the non-thread-safe version of PHP is ideal.

 

As far as precautions to be taken, the only thing off hand would be if you are trying to setup a script that multiple people use to read/write from a set file. You'd need to use proper file locking to prevent any corruption due to one process reading and another writing. Note that this is not something a thread-safe version of php would fix, thread safety is an entirely different and unrelated issue.

 

The above usually isn't an issue, as if you find yourself wanting to do that, you should just be using a database instead. When using a database, then the DB server will handle all the locking/concurrent access protections for you.

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.