1. thread theoretical basis: a) more frugal than processes: all code data in the thread is shared. B) convenience: communication is convenient because of data sharing. c) it follows the POSIX thread interface, called pthread, # include & lt; pthread. h & gt; 2. creation Thread: intpthread_create (pthre... 1. thread theoretical basis:
A) more frugal than processes: all code data in the thread is shared.
B) convenience: convenient communication because of data sharing
C) follow the POSIX thread interface, called pthread. # include
2. use the push function and pop to enclose the program segments.
3. press the cleanup function into the cleanup stack. when the included program does not run to POP and exits, the cleanup function is called, excluding return. If there are multiple PUSH entries
4. Rtn: clearing the function
5. Arg: clear function parameters
C) void pthread_cleanup_pop (int execute)
1. # include
2. clear the stack in the clear function pop-up window.
3. Execute: determines whether to Execute this function while the cleanup function is popped up. if it is not 0, Execute the function. if it is 0, do not Execute the function.
D) clearing function: the content defined by myself. The most important thing is to have a return statement.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service