![]() |
| | #1 |
| still a n00b Join Date: Jun 2002
Posts: 187
| thread and fork() which one could be used in which situation? I did read several posts, but still not clear. Thanks, |
| Jaguar is offline | |
| | #2 |
| . Join Date: Nov 2003
Posts: 293
| A process is a container for execution one or more threads. A process has to have at least one execution thread. fork() creates a process out of the old process, bringing along all of the threads. It takes a snapshot of all the variables, program counter, etc, and creates a new process with the same program counter, data, and code set. The forked process has a new process context, outside of the old one. A new thread remains inside the process context. |
| jim mcnamara is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Thread Prog in C language (seg fault) | kumars | C Programming | 22 | 10-09-2008 01:17 PM |
| What happens a thread calls fork()? | meili100 | C++ Programming | 3 | 09-11-2008 08:10 AM |
| fork a child or create a thread? | zhoufanking | C Programming | 3 | 06-21-2008 03:48 AM |
| fork() inside a thread | rpalmer | C Programming | 3 | 05-25-2007 02:29 AM |
| problems with fork | raja9911 | C Programming | 2 | 02-03-2006 07:48 AM |