Jump to content


thread safe vs non thread safe

  • Please log in to reply
2 replies to this topic

#1 neginf

  • Members
  • PipPip
  • Member
  • 23 posts

Posted 02 July 2013 - 01:57 PM

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 ?


#2 kicken

  • Gurus
  • Wiser? Not exactly.
  • 3,317 posts
  • LocationBonita, FL

Posted 02 July 2013 - 05:15 PM

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.
Did I help you out? Feeling generous? I accept tips via Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7
Kicken's World⦄ ⦃Recycle old CD's

#3 neginf

  • Members
  • PipPip
  • Member
  • 23 posts

Posted 03 July 2013 - 12:23 PM

Thank you very much.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users