Re: what is the preferred way to wait while polling a flag

2012-05-17 Thread Tristan Van Berkom
Ooops, forgot to CC the list: On Thu, May 17, 2012 at 1:43 PM, Rick Berger wrote: > In GTK+ 2.20, what is the preferred way to wait while polling a flag in > shared memory every 25 milliseconds in code something like this? The preferred thing to do is to never use polling for synchronizat

what is the preferred way to wait while polling a flag

2012-05-17 Thread Rick Berger
In GTK+ 2.20, what is the preferred way to wait while polling a flag in shared memory every 25 milliseconds in code something like this? gint n; for( n=10; n && (sharedMemory->flag != 1), n--) { /* wait 25 milliseconds */ } if( n == 0 ) { g_warning("Timed out while