This is the mail archive of the gcc-help@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]

Small confusing regarding __atomic_load_n()


Hi,

When I do something like:

thread 1:

   int count = 0;
   int *thread_var = &count;

thread 2:

   __atomic_store_n(thread_var, 7, __ATOMIC_RELEASE);


Do I then need to do the following in thread 3?

thread 3 option 1:

   *thread_var = __atomic_load_n(thread_var, __ATOMIC_ACQUIRE);

  
Or do this suffice?
   
thread 3 option 2:

   __atomic_load_n(thread_var, __ATOMIC_ACQUIRE);


Thanks,
  jules


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