Question about multithreads



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, 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?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]