4 ms·
I found this article a while ago > Every web request starts from a completely blank slate. Its namespace and globals are uninitialized, except for the standar
by heurisko 5y ago
I found this article a while ago
> Every web request starts from a completely blank slate. Its namespace and globals are uninitialized, except for the standard globals, functions and classes that provide primitive functionality and life support. By starting each request from a known state, we get a kind of organic fault isolation; if request t encounters a software defect and fails, this bug does not directly interfere with the execution of subsequent request t+1.
> An individual web request runs in a single PHP thread. This seems at first like a silly limitation. But since your program executes in the context of a web server, we have a natural source of concurrency available: web requests. Asynchronously curl’ing to localhost (or even another web server) provides a shared-nothing, copy-in/copy-out way of exploiting parallelism. In practice, this is safer and more resilient to error than the locks-and-shared-state approach that most other general-purpose languages provide.
https://slack.engineering/taking-php-seriously/ https://slack.engineering/taking-php-seriously/
- darthrupert 5y agoHow does this differ from how other web frameworks work? I thought almost all of them are shared-nothing.