develooper Front page | perl.ithreads | Postings from September 2008

Re: Lots of context switches with shared array

Thread Previous
Dean Arnold
September 23, 2008 12:18
Re: Lots of context switches with shared array
Message ID:
Thomas Karcher wrote:
> Hi Dean,
> If someone from the ithreads development team is listening: I guess this
> is an issue worth considering to have a solution for ... e. g. a
> thread-safe array (similar to Thread::Queue) or a more fine-granular
> locking mechanism for shared arrays ... not that I really thought it
> through :)

FWIW: Thread::Queue *is* a thread::shared array, w/ just a few methods
added. And it suffers from the same issues as your sort-merge, assuming
enough threads are accessing the queue concurrently.

The core issue is the global lock on the shared interpretter; until thats removed
(which doesn't seem likely in the near future), shared data will remain
a "contentious" issue.

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