Search Postgresql Archives

Re: thread_test.c problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux