Re: multithreading, dual-core
Re: multithreading, dual-core
- Subject: Re: multithreading, dual-core
- From: George Warner <email@hidden>
- Date: Mon, 26 Feb 2007 10:30:18 -0800
- Thread-topic: multithreading, dual-core
On Sun, 25 Feb 2007 11:37:21 -0800, Shawn Erickson <email@hidden>
wrote:
> Often it is the algorithm and not the locking overhead that is a problem.
One "newbie" mistake I often see is over locking. The fastest and least
likely lock to deadlock is the ones you can completely avoid. Google
"lockless programming".
Also read up on read/write (rw)locks. If you have a data structure that's
mostly read and only occasionally written this lock will allow multiple
readers simultaneous mutual access except when a write is requested; then
the writer is granted exclusive access.
If at all possible use atomic operators (great for ref-count modifiers);
then spin-locks and only as a last resort conditional mutexes.
P.S. Welcome to the Schizophrenia. ;-)
--
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)
_______________________________________________
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