Jump to content


Photo

thread safe vs non thread safe


  • Please log in to reply
2 replies to this topic

#1 neginf

neginf

    Member

  • Members
  • PipPip
  • 23 posts

Posted 02 July 2013 - 08:57 AM

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

kicken

    Wiser? Not exactly.

  • Gurus
  • 2,709 posts
  • LocationBonita, FL

Posted 02 July 2013 - 12: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.
Recycle your old CD's, don't trash them!
Did I help you out?  Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7

#3 neginf

neginf

    Member

  • Members
  • PipPip
  • 23 posts

Posted 03 July 2013 - 07:23 AM

Thank you very much.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com