423 Subj : Re: reliability of setting thread priority To : comp.programming.threads From : David Schwartz Date : Wed Feb 23 2005 08:47 pm wrote in message news:1109219095.518323.167190@o13g2000cwo.googlegroups.com... > How reliable/portable/etc is messing with thread priorities? What do I > mean? Well, let me explain the story: > In particular, similar to the problems of static local initializers > and implementing pthread_once, etc., I want to initialize a critical > section in a thread safe manner. I would use another critical section > to guard the first CS, but that 'begs the question' as they say. :-) I > could use a global named mutex (CreateMutex() under Win32), but that > seems a bit heavy - and if I was going to use a mutex to make a > criticalsection, maybe I should just use a mutex where the CS was going > in the first place. So I'm left with using one or two global > variables, and using atomic get and sets, etc., to manage them. Why not a global static mutex? DS . 0