context switch during doubly linked list creation

后端 未结 1 590
情话喂你
情话喂你 2021-01-25 03:56

There\'s an example in Maurice Bach\'s The Design of the Unix Operating System that mentions how it\'s possible for a doubly linked list to be destroyed due to a context switch

相关标签:
1条回答
  • 2021-01-25 04:57

    My mistake in not reading carefully enough - Maurice says in the page before the diagrams how the context switch would break the code IF another process "were to manipulate the pointers on the linked list before the original process ran again." I was confused because I was trying to get enough information from just the diagram and the code, neither of which mentioned the fact that the process being switched to would be handling the same data structure in memory (despite there having been a context switch.. still not a 100% clear/motivated example imho). Either way, apparently my own kernel had a bit of data corruption when i made the context switch from reading one page to the next..

    0 讨论(0)
提交回复
热议问题