Questions:
1. After the code in the Run method finishes executing, the standalone thread exits immediately and waits for the appropriate time to be joined by the creator thread.
can only creator threads join join, and what is join?
2, Thread extends threaded implements countable , traversable , arrayaccess {}
is threaded an interface? How to use the interface?
Summary:
Thread class
The following pattern is: public-private Property The "static" return value belongs to the class:: Method name (parameter)
1, public integer thread::getcreatorid ( void)
Returns the thread ID that created the current thread.
Usage: Create a thread object that can be called inside a class:$this->getCreatorId();
2,public static Thread thread::getcurrentthread ( void)
Gets a reference to the current thread of execution.
Usage:public function run() {
var_dump(Thread::getCurrentThread());
}
3,public static integer thread::getcurrentthreadid ( void)
Returns the ID of the current thread of execution
PHP Multi-threaded learning