suppose that a UNIX kernel supports threads. would u expect the thread system call to take about the same amount of time to execute as fork()?Why and why not?
Suppose that a UNIX kernel supports threads. would u expect the thread system call to take about the same amou
Actually, a call to create a thread should (provided it were written properly) take less time to spawn a new thread. The fork() function, however, actually spawns a new process.
The difference between processes and threads is that a process is a thread which contains all of the resources that are used by the applications. Therefore, you have a "thread" and you have a "thread plus resources" (process).
Because there is extra setup time involved in setting up the resources for the process, the fork() call would take more time in setting up a process than it would a thread.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment