Re: pthreads and standard C library calls and maybe magic Xcode switches
Re: pthreads and standard C library calls and maybe magic Xcode switches
- Subject: Re: pthreads and standard C library calls and maybe magic Xcode switches
- From: Cem Karan <email@hidden>
- Date: Wed, 22 Aug 2007 07:37:05 -0400
On Aug 21, 2007, at 5:53 PM, Shawn Erickson wrote:
On 8/21/07, Cem Karan <email@hidden> wrote:
I'm continuing to work on my pthreads based program, and realized
that I've run into a potential problem.
I think you misunderstand what volatile means and when you need to
use it.
In the examples you have given the use of volatile isn't needed since
the locking constructs you are using will ensure proper memory
barriers exist.
Are you saying that the locking constructs will ensure that the cache
is always flushed back to main memory? That locking and unlocking is
guaranteed as a sequence point for that, and therefore, regardless of
how a function is compiled (e.g., linked in static library that
wasn't volatile qualified), as long as there is a lock, it flushes to
main memory? I was talking to one of my coworkers to find out if
this is true, and he wasn't sure; that worried me because he is on
the C standards committee, and knows a heck of a lot more than I do
about all this...
Thanks,
Cem Karan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden