Jump to content

Archived

This topic is now archived and is closed to further replies.

neginf

thread safe vs non thread safe

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 ?

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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