Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
System call
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Processor mode and context switching == System calls in most [[Unix-like]] systems are processed in [[kernel mode]], which is accomplished by changing the processor execution mode to a more privileged one, but no ''process'' [[context switch]] is necessary{{snd}} although a ''privilege'' context switch does occur. The hardware sees the world in terms of the execution mode according to the processor [[status register]], and processes are an abstraction provided by the operating system. A system call does not generally require a context switch to another process; instead, it is processed in the context of whichever process invoked it.<ref name="Bach1986pp15-16">Bach, Maurice J. (1986), ''The Design of the UNIX Operating System'', Prentice Hall, pp. 15β16.</ref><ref>{{cite web |url=http://www.progclub.org/pipermail/list/2011-October/000150.html |title=Discussion of system call implementation at ProgClub including quote from Bach 1986 |year=2011<!-- 1 October --> |first=John |last=Elliot |access-date=1 October 2011 |archive-date=24 July 2012 |archive-url=https://web.archive.org/web/20120724153438/https://www.progclub.org/pipermail/list/2011-October/000150.html |url-status=dead }}</ref> In a [[Multithreading (computer architecture)|multithreaded]] process, system calls can be made from multiple [[Thread (computing)|threads]]. The handling of such calls is dependent on the design of the specific operating system kernel and the application runtime environment. The following list shows typical models followed by operating systems:<ref>{{cite web |url=http://www.cs.uic.edu/~jbell/CourseNotes/OperatingSystems/4_Threads.html |title=Threads}}</ref><ref>{{cite web |url=http://kevinmarquet.net/wp-content/uploads/threading.pdf |title=Threading Models}}</ref> * ''Many-to-one'' model: All system calls from any user thread in a process are handled by a single kernel-level thread. This model has a serious drawback{{snd}} any blocking system call (like awaiting input from the user) can freeze all the other threads. Also, since only one thread can access the kernel at a time, this model cannot utilize multiple cores of processors. * ''One-to-one'' model: Every user thread gets attached to a distinct kernel-level thread during a system call. This model solves the above problem of blocking system calls. It is found in all major [[Linux distribution]]s, [[macOS]], [[iOS]], recent [[Microsoft Windows|Windows]] and [[Solaris (operating system)|Solaris]] versions. * ''Many-to-many'' model: In this model, a pool of user threads is mapped to a pool of kernel threads. All system calls from a user thread pool are handled by the threads in their corresponding kernel [[thread pool]]. * ''Hybrid'' model: This model implements both many-to-many and one-to-one models depending upon the choice made by the kernel. This is found in old versions of [[IRIX]], [[HP-UX]] and [[Solaris (operating system)|Solaris]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)