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: Olivier Tristan <email@hidden>
- Date: Wed, 22 Aug 2007 14:18:19 +0200
Cem Karan wrote:
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...
If the shared data access(read and write) is always locked then no problem.
Your memcpy call should just be surrounded by lock.
If you're using your memory for real time data feed from outside, lock
can hurt performances a lot, then take a look at some LockFree
RingBuffer impl.
I hope that you didn't explain correctly your problem to your friend,
otherwise my faith in the C standards committee has been lost.
HTH
--
Olivier Tristan
Ultimate Sound Bank
_______________________________________________
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