Re: An error on trying to sort shared data using slice

2013-01-28 Thread Sparsh Mittal
Thanks a lot. Your code is very valuable to explain the whole concept. I have changed my code based on it.

Re: An error on trying to sort shared data using slice

2013-01-28 Thread Ali Çehreli
On 01/28/2013 12:33 PM, Sparsh Mittal wrote: > My requirement is to sort a portion of an array in each thread, such > that there is no overlap b/w portions and all portions together make the > whole array. > > So I am taking array as shared. Currently, in each thread, I am taking a > slice of tha

Re: An error on trying to sort shared data using slice

2013-01-28 Thread Sparsh Mittal
Thanks a lot. Actually, I am using std.concurrency, following your tutorial: http://ddili.org/ders/d.en/concurrency.html. Thanks for that tutorial. My requirement is to sort a portion of an array in each thread, such that there is no overlap b/w portions and all portions together make the who

Re: An error on trying to sort shared data using slice

2013-01-28 Thread bearophile
Sparsh Mittal: Thanks for your reply and link (which I will try to follow). Good. However, I am trying to write a parallel program where I have a big array. Multiple (e.g. 2, 4, 8) threads do work on part of those arrays. Afterwards, they sort their portions of array and return the answer

Re: An error on trying to sort shared data using slice

2013-01-28 Thread Sparsh Mittal
Thanks for your reply and link (which I will try to follow). However, I am trying to write a parallel program where I have a big array. Multiple (e.g. 2, 4, 8) threads do work on part of those arrays. Afterwards, they sort their portions of array and return the answer to main. So, I have mad

An error on trying to sort shared data using slice

2013-01-28 Thread Sparsh Mittal
Purpose: I am trying to sort only a range of values in an array of struct (the struct has two fields and I want to sort on one of its fields using myComp function below). However, I am getting this error: ../src/phobos/std/algorithm.d(7731): Error: cannot implicitly convert expression (assume