| From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> | 
|---|---|
| To: | Greg Stark <gsstark(at)mit(dot)edu> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: thread_test.c problems | 
| Date: | 2004-04-05 16:23:49 | 
| Message-ID: | 200404051623.i35GNnP01568@candle.pha.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general pgsql-hackers | 
Greg Stark wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> 
> > wespvp(at)syntegra(dot)com wrote:
> > > On 4/4/04 11:43 PM, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)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(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bob.Henkel | 2004-04-05 16:29:12 | Re: Storing jpgs | 
| Previous Message | C G | 2004-04-05 16:20:25 | Storing jpgs | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Hans-Jürgen Schönig | 2004-04-05 16:33:51 | Re: Socket communication for contrib | 
| Previous Message | Bruce Momjian | 2004-04-05 16:20:28 | Re: Socket communication for contrib |