首页 > 试题广场 >

Discuss how the clone()operati

[问答题]

Discuss how the clone()operation supported by Linux is used to support both processes and threads.

推荐

Answer:In Linux,threads are implemented within the kernel by a clone mechanism that creates a new process within the same virtual address space as the parent process.Unlike some kernel-based thread packages,the Linux kernel does not make any distinction between threads and processes;a thread is simply a process that did not create a new virtual address space when it was initialized.The main advantage of implementing threads in the kernel rather than in a user-mode library are that:

·kernel threaded systems can take advantage of multiple processors if they are available;and

·if one thread blocks in a kernel service routine(for example,a system call or page fault),other threads are still able to run.

发表于 2018-05-05 21:04:32 回复(0)