Static functions - independence in threads
- From: algorimancer <algorimancer@xxxxxxxxx>
- Date: 18 May 2007 08:52:05 -0700
Given a parallelized loop (for example, via OpenMP's "parallel for"
utility) which calls a static function, does each unit of execution
(thread) traverse an independent version of the static function, or do
they all traverse the same shared code? In other words, do the
threads have to take turns accessing that static function, or do they
each get their own copy which they can call independently? Clearly
this would affect the efficiency of the threading. I've searched for
this answer at multiple books/sites/groups, and at best I get
allusions which hint at the notion that each thread gets its own
independent copy of the static functions... but I'd really like to
know with confidence.
.
- Follow-Ups:
- Re: Static functions - independence in threads
- From: John Dallman
- Re: Static functions - independence in threads
- From: hexa
- Re: Static functions - independence in threads
- From: Dmitriy Vyukov
- Re: Static functions - independence in threads
- Prev by Date: MPMC Unbounded FIFO Queue w/ 1 CAS/Operation. No jokes.
- Next by Date: Re: Static functions - independence in threads
- Previous by thread: MPMC Unbounded FIFO Queue w/ 1 CAS/Operation. No jokes.
- Next by thread: Re: Static functions - independence in threads
- Index(es):
Relevant Pages
|