Re: thread_test.c problems

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: thread_test.c problems
Дата
Msg-id 200404051623.i35GNnP01568@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: thread_test.c problems  (Greg Stark <gsstark@mit.edu>)
Список 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 по дате отправления:

Предыдущее
От: "C G"
Дата:
Сообщение: Storing jpgs
Следующее
От: Bob.Henkel@hartfordlife.com
Дата:
Сообщение: Re: Storing jpgs