Content deleted Content added
m.e. |
Ged Haywood (talk | contribs) m →Processes: Clarification of acronym for later paragraphs. |
||
Line 25:
At the kernel level, a ''process'' contains one or more ''kernel threads'', which share the process's resources, such as memory and file handles – a process is a unit of resources, while a thread is a unit of scheduling and execution. Kernel scheduling is typically uniformly done preemptively or, less commonly, cooperatively. At the user level a process such as a [[runtime system]] can itself schedule multiple threads of execution. If these do not share data, as in Erlang, they are usually analogously called processes,<ref>{{Cite web |title=Erlang: 3.1 Processes |url=http://www.erlang.org/doc/getting_started/conc_prog.html}}</ref> while if they share data they are usually called ''(user) threads'', particularly if preemptively scheduled. Cooperatively scheduled user threads are known as ''[[fiber (computer science)|fibers]]''; different processes may schedule user threads differently. User threads may be executed by kernel threads in various ways (one-to-one, many-to-one, many-to-many). The term "[[light-weight process]]" variously refers to user threads or to kernel mechanisms for scheduling user threads onto kernel threads.
A ''process'' is a "heavyweight" unit of kernel scheduling, as creating, destroying, and switching processes is relatively expensive. Processes own [[Resource (computer science)|resources]] allocated by the operating system. Resources include memory (for both code and data), [[Handle (computing)|file handles]], sockets, device handles, windows, and a [[process control block]]. Processes are ''isolated'' by [[process isolation]], and do not share address spaces or file resources except through explicit methods such as inheriting file handles or shared memory segments, or mapping the same file in a shared way – see [[interprocess communication]]. Creating or destroying a process is relatively expensive, as resources must be acquired or released. Processes are typically preemptively multitasked, and process switching is relatively expensive, beyond basic cost of [[context switching]], due to issues such as cache flushing (in particular, process switching changes virtual memory addressing, causing invalidation and thus flushing of an untagged [[translation lookaside buffer]] (TLB), notably on x86).
===Kernel threads===
|