This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||||||
|
User and kernel mode switching
"When a transition between user mode and kernel mode is required in an operating system, a context switch is not necessary; a mode transition is not by itself a context switch. However, depending on the operating system, a context switch may also take place at this time." A mode transition is not a context, but the context switch is made anyway?
statistical data seems to be missing? -- paniq
$ vmstat 3 30 procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 41012 72748 80508 1074072 0 0 10 12 24 18 6 1 93 0 0 0 41012 72400 80516 1074104 0 0 0 23 494 786 6 1 93 0 1 0 41012 72384 80524 1074104 0 0 0 20 524 871 36 1 63 0 1 0 41012 71812 80564 1074332 0 0 83 51 545 1227 16 2 82 0 0 0 41012 71964 80576 1074480 0 0 43 33 531 940 13 2 85 0 0 0 41012 71856 80584 1074472 0 0 0 37 538 983 12 1 87 0 0 0 41012 71980 80584 1074480 0 0 0 0 566 1130 14 2 84 0
41.244.45.37 ( talk) —Preceding undated comment was added at 11:11, 10 November 2008 (UTC).
I removed:
What does ELF have to do with context switching? The discussion of stdin / stdout / stderr that follows doesn't make any sense, either. Neilc 01:10, 24 July 2005 (UTC)
"Clearly, there is a necessity to switch contexts when issuing interrupts: so that the interrupt handler can be executed, the state of the currently running process must be suspended."
This needs an explanation. The article gives the impression that all interrupts results in a context swith. This is not consistent with my understanding of interrupts. Rather it should depend on the type of the interrupt and the interrupt handling framework (the OS). Do you say that a context switch occurs when you use a DOS interrupt call? If that is the case, what's the difference between such a call and a normal function call?
-- Patrik Hägglund 18:15, 21 June 2006 (UTC)
What about the concept of user context switching? As in "the PSP is crap because it forces the programmer to context switch too often"? Does this usage deserve a mention? Sam Wilson 00:48, 24 July 2006 (UTC)
Is a task gate the same thing as a Barrier_(computer_science)? Mateja 01:11, 13 November 2006 (UTC)
Is there a limit to number of switchframes and contexts maintained by a CPU? Are there examples for Xeon, Opteron, Itanium, Pentium?
What are the differences between register, task, thread and process context switches? what are the relative time penalty? when are they used?
I removed the stub-section "Within psychology" containing the text
Is there anything on Wikipedia about context switching in terms of psychology? If there is, I can't find it; if the concept is actually used in psychology, there should be a link to a relevant page. - Shai-kun 04:27, 5 June 2007 (UTC)
user & kernal mode of switching interaction between process and OS —Preceding unsigned comment added by 59.92.199.21 ( talk) 08:38, 25 January 2008 (UTC)
"Task switching" re-directs here, but it should re-direct to "Task Switching (psychology)", whose primary title is actually "task switching". The psychology article should have an "Other uses" blurb at the top that re-directs here. The top 2 results on Google direct to Psychology articles, indicating that the psychology usage is more prevalent-- though the first two pages show roughly a 50/50 split, so it's pretty close. Still, since the psychology article is actually labeled "task switching" and this one is "context switching", i think it makes more sense to have the psychology article as the default. — Preceding unsigned comment added by 168.7.237.143 ( talk) 22:55, 18 July 2011 (UTC)
I suggest merging the stubs process switching latency and thread switching latency into context switch. My understanding is that these latencies never occur without a context switch. Perhaps a single encyclopedia article could easily cover all of them. -- DavidCary ( talk) 06:00, 28 April 2012 (UTC)
@ David Latapie: In response to this edit: while the concepts are superficially similar, they're from different fields and I think it would only confuse matters to cover them in a single article. I've converted it to a hatnote. Maybe human context switching would work as a section in human multitasking or a separate article, if you're interested in working on that. -- intgr [talk] 22:26, 16 March 2016 (UTC)
The definition of the components of an execution context would be helpful to have in this article. That might mean just using that term instead of "state" in a few places. Otherwise, it's a technical term that few novices to the field seeking to learn about a Context Switch will understand. Could execution context have it's own article? SamaelBeThouMyAlly ( talk) 13:59, 12 September 2017 (UTC)
The following Wikimedia Commons file used on this page has been nominated for deletion:
Participate in the deletion discussion at the nomination page. — Community Tech bot ( talk) 17:36, 21 September 2018 (UTC)
This article has the Incomprehensible template applied.
It's not obvious to me whether this is appropriate. Maybe Technical would be more appropriate, but as a relative outsider (no formal CS background) I actually still find this reasonably readable.
Flinker123 ( talk) 08:07, 13 July 2021 (UTC)
Surely a context switch includes not only saving the context of the current thread or process, but also restoring the context of a different thread or context. -- Shmuel (Seymour J.) Metz Username:Chatul ( talk) 11:48, 11 May 2022 (UTC)
"causing the program to wait and a wait for function call to the released setting the current statement to go to sleep and wait for the syscall to wake it up. To maintain concurrency however the program needs to re-execute the new value and the sleeping process together again."
This sentences are not easy to understand. They contain many concationations with and: "to wait, and a wait, ... and wait" Additionally it sounds wrong. CPUs usually do no execute "values". They execute instructions.
In the sentence: "[...] a wait for function call to the released setting" I think "the" should be replaced with "be". -> to be released -- 95.91.241.231 ( talk) 09:35, 23 July 2022 (UTC)
This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||||||
|
User and kernel mode switching
"When a transition between user mode and kernel mode is required in an operating system, a context switch is not necessary; a mode transition is not by itself a context switch. However, depending on the operating system, a context switch may also take place at this time." A mode transition is not a context, but the context switch is made anyway?
statistical data seems to be missing? -- paniq
$ vmstat 3 30 procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 41012 72748 80508 1074072 0 0 10 12 24 18 6 1 93 0 0 0 41012 72400 80516 1074104 0 0 0 23 494 786 6 1 93 0 1 0 41012 72384 80524 1074104 0 0 0 20 524 871 36 1 63 0 1 0 41012 71812 80564 1074332 0 0 83 51 545 1227 16 2 82 0 0 0 41012 71964 80576 1074480 0 0 43 33 531 940 13 2 85 0 0 0 41012 71856 80584 1074472 0 0 0 37 538 983 12 1 87 0 0 0 41012 71980 80584 1074480 0 0 0 0 566 1130 14 2 84 0
41.244.45.37 ( talk) —Preceding undated comment was added at 11:11, 10 November 2008 (UTC).
I removed:
What does ELF have to do with context switching? The discussion of stdin / stdout / stderr that follows doesn't make any sense, either. Neilc 01:10, 24 July 2005 (UTC)
"Clearly, there is a necessity to switch contexts when issuing interrupts: so that the interrupt handler can be executed, the state of the currently running process must be suspended."
This needs an explanation. The article gives the impression that all interrupts results in a context swith. This is not consistent with my understanding of interrupts. Rather it should depend on the type of the interrupt and the interrupt handling framework (the OS). Do you say that a context switch occurs when you use a DOS interrupt call? If that is the case, what's the difference between such a call and a normal function call?
-- Patrik Hägglund 18:15, 21 June 2006 (UTC)
What about the concept of user context switching? As in "the PSP is crap because it forces the programmer to context switch too often"? Does this usage deserve a mention? Sam Wilson 00:48, 24 July 2006 (UTC)
Is a task gate the same thing as a Barrier_(computer_science)? Mateja 01:11, 13 November 2006 (UTC)
Is there a limit to number of switchframes and contexts maintained by a CPU? Are there examples for Xeon, Opteron, Itanium, Pentium?
What are the differences between register, task, thread and process context switches? what are the relative time penalty? when are they used?
I removed the stub-section "Within psychology" containing the text
Is there anything on Wikipedia about context switching in terms of psychology? If there is, I can't find it; if the concept is actually used in psychology, there should be a link to a relevant page. - Shai-kun 04:27, 5 June 2007 (UTC)
user & kernal mode of switching interaction between process and OS —Preceding unsigned comment added by 59.92.199.21 ( talk) 08:38, 25 January 2008 (UTC)
"Task switching" re-directs here, but it should re-direct to "Task Switching (psychology)", whose primary title is actually "task switching". The psychology article should have an "Other uses" blurb at the top that re-directs here. The top 2 results on Google direct to Psychology articles, indicating that the psychology usage is more prevalent-- though the first two pages show roughly a 50/50 split, so it's pretty close. Still, since the psychology article is actually labeled "task switching" and this one is "context switching", i think it makes more sense to have the psychology article as the default. — Preceding unsigned comment added by 168.7.237.143 ( talk) 22:55, 18 July 2011 (UTC)
I suggest merging the stubs process switching latency and thread switching latency into context switch. My understanding is that these latencies never occur without a context switch. Perhaps a single encyclopedia article could easily cover all of them. -- DavidCary ( talk) 06:00, 28 April 2012 (UTC)
@ David Latapie: In response to this edit: while the concepts are superficially similar, they're from different fields and I think it would only confuse matters to cover them in a single article. I've converted it to a hatnote. Maybe human context switching would work as a section in human multitasking or a separate article, if you're interested in working on that. -- intgr [talk] 22:26, 16 March 2016 (UTC)
The definition of the components of an execution context would be helpful to have in this article. That might mean just using that term instead of "state" in a few places. Otherwise, it's a technical term that few novices to the field seeking to learn about a Context Switch will understand. Could execution context have it's own article? SamaelBeThouMyAlly ( talk) 13:59, 12 September 2017 (UTC)
The following Wikimedia Commons file used on this page has been nominated for deletion:
Participate in the deletion discussion at the nomination page. — Community Tech bot ( talk) 17:36, 21 September 2018 (UTC)
This article has the Incomprehensible template applied.
It's not obvious to me whether this is appropriate. Maybe Technical would be more appropriate, but as a relative outsider (no formal CS background) I actually still find this reasonably readable.
Flinker123 ( talk) 08:07, 13 July 2021 (UTC)
Surely a context switch includes not only saving the context of the current thread or process, but also restoring the context of a different thread or context. -- Shmuel (Seymour J.) Metz Username:Chatul ( talk) 11:48, 11 May 2022 (UTC)
"causing the program to wait and a wait for function call to the released setting the current statement to go to sleep and wait for the syscall to wake it up. To maintain concurrency however the program needs to re-execute the new value and the sleeping process together again."
This sentences are not easy to understand. They contain many concationations with and: "to wait, and a wait, ... and wait" Additionally it sounds wrong. CPUs usually do no execute "values". They execute instructions.
In the sentence: "[...] a wait for function call to the released setting" I think "the" should be replaced with "be". -> to be released -- 95.91.241.231 ( talk) 09:35, 23 July 2022 (UTC)