Re: Question about multithreads

2006-11-01 Thread John Cupitt
On 10/31/06, John Cupitt <[EMAIL PROTECTED]> wrote: > If the value doesn't change, or you don't mind if changes are not seen > by other threads for a while, then it's OK to skip the mutex. I forgot to say: http://developer.gnome.org/doc/API/2.0/glib/glib-Atomic-Operations.html Can save you an ex

Re: Question about multithreads

2006-10-31 Thread Chris Vine
On Tuesday 31 October 2006 22:00, Paul Pogonyshev wrote: > Tomasz Jankowski wrote: > > I generaly know how to write multithreads applications (so far code, > > which I wrote works fine). However I'm not sure if I should always lock > > and unlock mutex when I'm accesing some global data from thread

Re: Question about multithreads

2006-10-31 Thread John Cupitt
On 10/31/06, Tomasz Jankowski <[EMAIL PROTECTED]> wrote: > wrote works fine). However I'm not sure if I should always lock and unlock > mutex when I'm accesing some global data from thread. I know, that i'm If the value is changing and the changes are being used to signal between threads, then you

Re: Question about multithreads

2006-10-31 Thread Paul Pogonyshev
Tomasz Jankowski wrote: > I generaly know how to write multithreads applications (so far code, which I > wrote works fine). However I'm not sure if I should always lock and unlock > mutex when I'm accesing some global data from thread. I know, that i'm > obligated to sorround with mutex's lock and

Question about multithreads

2006-10-31 Thread Tomasz Jankowski
Hi! I generaly know how to write multithreads applications (so far code, which I wrote works fine). However I'm not sure if I should always lock and unlock mutex when I'm accesing some global data from thread. I know, that i'm obligated to sorround with mutex's lock and unlock each part of code, w