Re: Lots of context switches with shared array

2008-09-23 Thread Dean Arnold
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

Re: Lots of context switches with shared array

2008-09-23 Thread Thomas Karcher
Hi Dean, > > Thanks for the enlightening answer. Do you think it is possible to > > "trick" threads::shared's lock with a reference to the array, i. e. the > > reference is shared but the array itself isn't? > Not certain how you intend to do that ? Are you intending to write your > own XS impleme

Re: Lots of context switches with shared array

2008-09-23 Thread Dean Arnold
Thomas Karcher wrote: Hi Dean, Thanks for the enlightening answer. Do you think it is possible to "trick" threads::shared's lock with a reference to the array, i. e. the reference is shared but the array itself isn't? Not certain how you intend to do that ? Are you intending to write your ow

Re: Lots of context switches with shared array

2008-09-23 Thread Thomas Karcher
Hi Dean, > > I'm writing a multithreaded merge sort that suffers from massive amounts > > of context switches (as seen by vmstat). The outline of the program is > > roughly as follows: > > > > > > my @sortdata : shared; // the values to be sorted > > [...] > > // starting two threads >

Re: Lots of context switches with shared array

2008-09-23 Thread Dean Arnold
Thomas Karcher wrote: Hi there, I'm writing a multithreaded merge sort that suffers from massive amounts of context switches (as seen by vmstat). The outline of the program is roughly as follows: my @sortdata : shared; // the values to be sorted [...] // starting two threads new threads(

Lots of context switches with shared array

2008-09-23 Thread Thomas Karcher
Hi there, I'm writing a multithreaded merge sort that suffers from massive amounts of context switches (as seen by vmstat). The outline of the program is roughly as follows: my @sortdata : shared; // the values to be sorted [...] // starting two threads new threads( \&mergesort_string, $beg