Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Interrupts in MacOS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interrupts in MacOS X



Quinn <email@hidden> wrote:
> At 7:44 +1000 15/3/01, Atsushi Nakagawa wrote:
>> In Mac OS X, because it uses "preemptive multitasking", can it mean that if
>> my async callback function takes too long to complete, my main thread, which
>> was interrupted by the callback, can be reactivated before the callback
>> returns?
>
> Yes.

Thanks. So unlike the current co-operative multitasking system, in Mac OS
X, the following design will be completely safe from deadlocks?


UInt8 gLock = 0;

AtomicDoStuff()
{
while (!OTCompareAndSwap8(0, 1, &gLock)) ;

// do atomic stuff here

gLock = 0;
}


--
Atsushi Nakagawa
(email@hidden)
Changes are made when there is inconvenience.


References: 
 >Re: Interrupts in MacOS X (From: Quinn <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.