develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [PATCH] Adding callbacks to the core

Thread Previous | Thread Next
Dave Mitchell
August 22, 2001 08:06
Re: [PATCH] Adding callbacks to the core
Message ID:
Nicholas Clark <> wrote:
> [I don't understand threading, but I've read enough from Dan and Alan to
> learn that multi-CPU boxes will quite happily run different threads of
> the same process on the different CPUs at the same time, and this often
> does horrible things to code that was written without thinking about this]

IIRC, the main danger is that you cannot assume much about the visibility
of changes in shared memory between threads: just because thread A on
CPU 1 wrote to shared memory at location N chronologically before thread
B on on processor 2 tries to read it, doesnt mean that thread B will see the 
change - due to cache architectures etc. The pthreads book has some detailed
disussions on what you can and can't assume around mutexes, thread creation
etc etc.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About