Data Storage

As a rule of thumb, any data type that can be serialized can be used as a member of a Threaded object, it can be read and written from any context with a reference to the Threaded Object. Not every type of data is stored serially, basic types are stored in their true form. Complex types, Arrays, and Objects that are not Threaded are stored serially; they can be read and written to the Threaded Object from any context with a reference.

With the exception of Threaded Objects any reference used to set a member of a Threaded Object is separated from the reference in the Threaded Object; the same data can be read directly from the Threaded Object at any time by any context with a reference to the Threaded Object.

Resources

The extensions and functionality that define resources in PHP are completely unprepared for this kind of environment; pthreads makes provisions for resources to be shared among contexts, however most types of resource WILL have problems. Most of the time, resources should NOT be shared among contexts, and when they are they should be basic types like streams and sockets.

Officially, resources remain unsupported.

A Work in Progress

pthreads was and is an experiment with pretty good results. Any of its limitations or features may change at any time; that is the nature of experimentation. It’s limitations – often imposed by the implementation – exist for good reason. The aim of pthreads is to provide a useable solution to multi-tasking in PHP at any level, in the environment which pthreads executes, some restrictions and limitations are necessary in order to provide a stable environment.