php, multithreading and other doubts -
php, multithreading and other doubts -
morning
i have doubts the way php works. cant find reply anywhere on books thought nail stack ;)
so here goes:
lets assume have 1 single server php+apache installed. here beliefs:
1 - php can handle 1 request @ time. doesn't matter if apache can handle more 1 thread @ time because invoked php interpreter single threaded.
2 - belief 1 follows believe if server receives 4 calls @ same time these calls queued , executed 1 @ time. makes request lastly gets response last.
3 - 1 , 2 follows if cron-call url corresponding script heavy-lifting/time consuming stuff slow downwards server moment script returns.
whats true? whats false?
cheers
i see no reason why php not able handle multiple requests @ same time. said, may semi-true handling requests of single client, depending on type of script.
many scripts utilize sessions. when session_start() called, session beingness opened , locked. when execution of script ends, session beingness closed , unlocked (this can done manually). when there multiple requests same session, first requests opens , locks session, , sec request has wait until session unlocked. might create impression multiple php scripts cannot executed @ same time, that's true (partly) requests utilize same session (in other words - requests same browser). requests 2 clients (browsers) may processed parallelly long don't utilize resources (files, db tables etc) beingness locked/unlocked in other requests.
php
Comments
Post a Comment