Re: [fpc-devel] Multithreading wait for

2008-12-04 Thread Mattias Gaertner
On Thu, 4 Dec 2008 11:59:40 +0100 Jonas Maebe <[EMAIL PROTECTED]> wrote: >[...] > >> Unless it's already signalled, then it should run right through. > > It was changed in 2.2.0: > http://wiki.freepascal.org/User_Changes_2.2.0#RTLEvent_persistence Thanks. Michael, can you add that hint to the d

Re: [fpc-devel] Multithreading wait for

2008-12-04 Thread Jonas Maebe
On 04 Dec 2008, at 11:36, Mattias Gärtner wrote: Zitat von Vinzent Höfler <[EMAIL PROTECTED]>: Mattias Gaertner wrote: On Wed, 03 Dec 2008 19:41:12 +0100 Vinzent Höfler <[EMAIL PROTECTED]> wrote: If I understand RTLEventWaitFor correct, then it waits until another thread calls RTLeventSet

Re: [fpc-devel] Multithreading wait for

2008-12-04 Thread Marco van de Voort
In our previous episode, Mattias G?rtner said: > Yes, that works under Linux. But the documentation does not mention it, so I'm > not sure if this works under all platforms. > Maybe some other OS users can try if the following code runs through: Uses cthreads; > var > e: PRTLEvent; > begin >

Re: [fpc-devel] Multithreading wait for

2008-12-04 Thread Mattias Gärtner
Zitat von Vinzent Höfler <[EMAIL PROTECTED]>: > Mattias Gaertner wrote: > > On Wed, 03 Dec 2008 19:41:12 +0100 > > Vinzent Höfler <[EMAIL PROTECTED]> wrote: > > > > If I understand RTLEventWaitFor correct, then it waits until another > > thread calls RTLeventSetEvent. > > Unless it's already sig

Re: [fpc-devel] Multithreading wait for

2008-12-03 Thread Vinzent Höfler
Mattias Gaertner wrote: On Wed, 03 Dec 2008 19:41:12 +0100 Vinzent Höfler <[EMAIL PROTECTED]> wrote: If I understand RTLEventWaitFor correct, then it waits until another thread calls RTLeventSetEvent. Unless it's already signalled, then it should run right through. So I must check *before* c

Re: [fpc-devel] Multithreading wait for

2008-12-03 Thread Mattias Gaertner
On Wed, 03 Dec 2008 15:41:55 + Martin Friebe <[EMAIL PROTECTED]> wrote: > Mattias Gärtner wrote: > > Hi all, > > > > I'm looking for a high performance 'wait-for'. > > > > The situation: > > There are m threads working in parallel on n chunks of work (n>=m). > > The n chunks are indexed 0..n-1

Re: [fpc-devel] Multithreading wait for

2008-12-03 Thread Mattias Gaertner
On Wed, 03 Dec 2008 19:41:12 +0100 Vinzent Höfler <[EMAIL PROTECTED]> wrote: > Mattias Gärtner wrote: > > > The situation: > > There are m threads working in parallel on n chunks of work (n>=m). > > The n chunks are indexed 0..n-1. > > Sometimes one thread needs the result of some of the lower in

Re: [fpc-devel] Multithreading wait for

2008-12-03 Thread Vinzent Höfler
Mattias Gärtner wrote: The situation: There are m threads working in parallel on n chunks of work (n>=m). The n chunks are indexed 0..n-1. Sometimes one thread needs the result of some of the lower indexed chunks. For example the chunk number 5 needs chunks 0..2. So I have a function WaitForInde

Re: [fpc-devel] Multithreading wait for

2008-12-03 Thread Martin Friebe
Mattias Gärtner wrote: Hi all, I'm looking for a high performance 'wait-for'. The situation: There are m threads working in parallel on n chunks of work (n>=m). The n chunks are indexed 0..n-1. Sometimes one thread needs the result of some of the lower indexed chunks. For example the chunk numb

[fpc-devel] Multithreading wait for

2008-12-03 Thread Mattias Gärtner
Hi all, I'm looking for a high performance 'wait-for'. The situation: There are m threads working in parallel on n chunks of work (n>=m). The n chunks are indexed 0..n-1. Sometimes one thread needs the result of some of the lower indexed chunks. For example the chunk number 5 needs chunks 0..2. S