Path: chuka.playstation.co.uk!news From: gil@snsys.com (Gil Jaysmith) Newsgroups: scee.yaroze.programming.libraries Subject: Re: A critical question Date: Wed, 15 Oct 1997 10:16:42 GMT Organization: SN Systems Lines: 30 Message-ID: <344496f6.457037@news.playstation.co.uk> References: <344478C2.6263@dial.pipex.com> Reply-To: gil@snsys.com NNTP-Posting-Host: gil.snsys.com X-Newsreader: Forte Free Agent 1.11/32.235 >Can someone help clear up in my mind the use of the EnterCriticalSection() >and ExitCriticalSection() functions. I realize, presumably, the point >of entering a critical section is so that a piece of code can be >allowed to execute at maximum speed, having surpressed the vsync >interrupt. Does this simply mean then that CallBack functions are >disabled? What other interrupts etc. are surpressed when calling >EnterCriticalSection()? Given that root counters can be used in the pro libraries to cause events, perhaps critical sections are ordinarily more useful to the pros, and they've been left in the Net Yaroze libraries for the hell of it. >And lastly (I promise!), the User Guide says than a program is >automatically *in* a critical section when first run!!!!!! >Given that most library functions arent supposed to execute >reliably if called from a critical section, whats going on? (a typo?) The pro devrefs assert this as well, so it's unlikely to be a typo. Presumably it just means that interrupts are disabled by default at the point of user program entry. It also adds that service functions modifying kernel data must be executed in a critical section, which seems fair enough. "Do not attempt to understand. Simply obey." ;=) Gil Jaysmith SN Systems Software Ltd (http://www.snsys.com) Disclaimer: the ads are my employers' but the opinions are mine.