From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,283154b7bdd27d97 X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,283154b7bdd27d97 X-Google-Attributes: gidf678f,public From: Jeff Denham Subject: Re: test_and_set function for TRU64 Date: 1999/11/24 Message-ID: <383C4272.61513F8B@allaire.com>#1/1 X-Deja-AN: 552636205 Content-Transfer-Encoding: 7bit References: <3839FD96.BF4D1E8@oodb.syscom.com.tw> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@digex.net X-Trace: dca1-nnrp1.news.digex.net 943473269 207.86.119.34 (Wed, 24 Nov 1999 14:54:29 EST) Organization: Allaire Corporation MIME-Version: 1.0 NNTP-Posting-Date: Wed, 24 Nov 1999 14:54:29 EST Newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc Yao-Lu Tsai wrote: > Dear all, > > I need to implement a critical section on TRU64 UNIX. > Is there any function or system call like test_and_set > or compare_and_swap on TRU64 UNIX ? There's an undocumented routine in the C RTL called msem_tas() or some such. Do an nm on the library and grep for 'tas'. Also, if you're using threads, consider using a mutex. If you're not using threads, you can do what you want with the load-locked/store-conditional instructions. Grap around in /usr/include and look for asm directives you can clone.