This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimization/clarity coding : what is gcc able to do for me ?


> 
> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]