You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
b6b01eb4d8 | 5 years ago | |
---|---|---|
Makefile | 5 years ago | |
README.md | 5 years ago | |
main.c | 5 years ago | |
main_simple.c | 5 years ago |
README.md
Clone Thread Example
This C program uses clone() to create a new thread. It illustrates, that the new thread shares the same data and heap segment. The main process creates a new thread with clone. clone() will execute a function that prints a buffer to stdout and then waits 2 seconds and does it again. In the meantime, the main thread changes the content of the buffer. That the child thread prints different things shows that they are not seperate processes.
Compile
make
Run
./main