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 unlock each part of code, which
> acces some global variables, but I wonder if I can omit mutex locking when I
> do such fast thing like reading drom integer variable. Can I do it?

AFAIK, integer reading is atomic.  So you probably can since mutex locking
probably indicates you just protect against write-in-the-middle case, not
performing any synchronization.

Paul

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to