Optimization/clarity coding : what is gcc able to do for me ?
Robert Dewar
dewar@gnat.com
Sat Jan 15 15:21:00 GMT 2005
>
> That code wouldn't be thread-safe. If two threads need to access the same
> vector, you'd have to use a mutex, or bad things could happen.
>
> jlh
There is no rule against the use of shared variables, yes, of course you
have to be careful, but there are many algorithms that use variables
that are read by one task and written by another, that work fine. Surely
you are not claiming that these algorithms are never allowed in C.
More information about the Gcc
mailing list