Re: thread_test.c problems - Mailing list pgsql-general

From Bruce Momjian
Subject Re: thread_test.c problems
Date
Msg-id 200404051623.i35GNnP01568@candle.pha.pa.us
Whole thread Raw
In response to Re: thread_test.c problems  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
Greg Stark wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>
> > wespvp@syntegra.com wrote:
> > > On 4/4/04 11:43 PM, "Bruce Momjian" <pgman@candle.pha.pa.us> wrote:
> > >
> > > > OK, new patch applied that causes all threads to wait until the parent
> > > > checks their thread-specific pointers. I ran 1000 tests and all passed.
> > > > Hopefully it will good for you too.
> > >
> > > I'll try to give it a test tonight.
> >
> > Please grab CVS.  I added sched_yield() too.
>
> Make sure to test this on linux 2.6. They changed sched_yield() to not cause
> context switches in a lot of cases where it did previously. You might need a
> usleep() there instead or in addition.


Usleep is probably more unportable than sched_yield on platforms that
support threads.  I actually don't need sched_yield to context switch,
only to allow the other threads to complete.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: "C G"
Date:
Subject: Storing jpgs
Next
From: Bob.Henkel@hartfordlife.com
Date:
Subject: Re: Storing jpgs