Subj : Re: reliability of setting thread priority To : comp.programming.threads From : David Schwartz Date : Fri Feb 25 2005 03:33 pm wrote in message news:1109372884.926187.133540@f14g2000cwb.googlegroups.com... > Yes, I quite understand. I guess what I didn't explain is that for > sane or insane reasons, I'm basically writing my own pthread_once. I > just wondered if there was a better way than what boils down to a > global named mutex - which is by no means bad, but just wondering... > > AND, wondering about the consistency of setting thread priorities on > various platforms. No one has yet said that messing with thread > priorities is never consistent ie because you don't know the scheduling > algorithm or it is not widely supported, etc. > > But, yeah, the immediate result was for a pthread_once. You can't implement good primitives in a portable way. You need platform-specific atomic compare/exchange type operators. DS .