Ways for protecting shared data/process problems
- atomic operation: http://www.threadingbuildingblocks.org/docs/help/tbb_userguide/Atomic_Operations.htm
- apply a single variable as a lock, check it before entering critical session
- disable interrupt: http://stackoverflow.com/questions/3427546/what-is-meant-by-disabling-interrupts
- sometimes it's not necessary
- costs a lot
- interrupt mask
- device drive interrupt handler
- program reentry
- disable kernel preemption
- spin lock
- implemented by atomic operation
- run for loop while it's locked
No comments:
Post a Comment