RE: [Geekos-devel] Efficient implementing of semaphores...
Status: Pre-Alpha
Brought to you by:
daveho
From: Jaime Lafleur-V. <jv...@wa...> - 2003-02-02 18:48:03
|
Yes, indeed there is. Most architectures provide at least one atomic instruction that would enable you to implement critical sections and semaphore without having to resort to disabling interrupts. Example instructions that the hardware may provide atomically are: Test-and-set: operates on 1 bit of memory. Returns the previous value and sets the bit to 1. Swap: swaps to input values Since these operations would be atomic, they could be used to enforce a critical section. In GeekOS disabling of interrupts for atomicity is used in many places because the time period where interrupts are disabled is so small that it has little or no negative effect. Thus, I wouldn't be concerned with disabling of interrupts as long as the period is short. Jaime -----Original Message----- From: gee...@li... [mailto:gee...@li...] On Behalf Of Behrang Saeedzadeh Sent: Sunday, February 02, 2003 1:19 PM To: GeekOS Subject: [Geekos-devel] Efficient implementing of semaphores... Is there any other ways for implementing semaphore primitives rather than disabling interrupts in IA32? Thanks in advance. _____ Do you Yahoo!? Yahoo! <http://rd.yahoo.com/mail/mailsig/*http:/mailplus.yahoo.com> Mail Plus - Powerful. Affordable. Sign up now <http://rd.yahoo.com/mail/mailsig/*http:/mailplus.yahoo.com> |