0

I have a little understanding of CPU dispatcher. When there is an interrupt for IO or something context switching happens to execute some other process. Will swapping also occur (swap in and swap out) during this time? Will the old process be removed from the physical memory and loaded back again? Or does it stay in main memory all the time?

According to this how dispatcher works? I don't see any swapping.

Community
  • 1
  • 1
Iniyan Selvan
  • 421
  • 4
  • 9

2 Answers2

0

Will swapping also occur (swap in and swap out) during this time?

Swapin / Swapout and context switch have no direct relation. The page could be removed, if it referenced rarely (see page reclaim).

Alex Hoppus
  • 3,821
  • 4
  • 28
  • 47
0

There is a trend now a days to NOT swap processes at all. Swapping was common in the days of 16MB of memory and multi-user systems with 32GB of virtual addressing.

The more modern approach is to remove pages from idle processes when more physical memory is required.

Even in systems where entire processes are swapped out, that is usually done in response to memory demand; not context switching.

user3344003
  • 20,574
  • 3
  • 26
  • 62