Re: [HACKERS] Using a latch between a background worker process and a thread

2016-11-03 Thread Abbas Butt
Thanks every body for the detailed advise. Let me try replacing latches by condition variables. I will report the results here. On Wed, Nov 2, 2016 at 11:54 AM, Craig Ringer wrote: > On 2 November 2016 at 02:10, Robert Haas wrote: > > On Tue, Nov

Re: [HACKERS] Using a latch between a background worker process and a thread

2016-11-02 Thread Craig Ringer
On 2 November 2016 at 02:10, Robert Haas wrote: > On Tue, Nov 1, 2016 at 12:35 PM, Abbas Butt > wrote: >> Hi, >> Consider this situation: >> 1. I have a background worker process. >> 2. The process creates a latch, initializes it using

Re: [HACKERS] Using a latch between a background worker process and a thread

2016-11-01 Thread Robert Haas
On Tue, Nov 1, 2016 at 12:35 PM, Abbas Butt wrote: > Hi, > Consider this situation: > 1. I have a background worker process. > 2. The process creates a latch, initializes it using InitLatch & resets it. > 3. It then creates a thread and passes the latch created in

[HACKERS] Using a latch between a background worker process and a thread

2016-11-01 Thread Abbas Butt
Hi, Consider this situation: 1. I have a background worker process. 2. The process creates a latch, initializes it using InitLatch & resets it. 3. It then creates a thread and passes the latch created in step 2 to it. To pass it, the process uses the last argument of pthread_create. 4. The