Re: [HACKERS] asynchronous execution

Поиск
Список
Период
Сортировка
От Kyotaro HORIGUCHI
Тема Re: [HACKERS] asynchronous execution
Дата
Msg-id 20170725.181125.53006939.horiguchi.kyotaro@lab.ntt.co.jp
обсуждение исходный текст
Ответ на Re: [HACKERS] asynchronous execution  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Ответы Re: [HACKERS] asynchronous execution  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hello,

8bf58c0d9bd33686 badly conflicts with this patch, so I'll rebase
this and added a patch to refactor the function that Anotonin
pointed. This would be merged into 0002 patch.

At Tue, 18 Jul 2017 16:24:52 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp> wrote in
<20170718.162452.221576658.horiguchi.kyotaro@lab.ntt.co.jp>
> I'll put an upper limit to the number of waiters processed at
> once. Then add a comment like that.
> 
> > Actually the reason I thought of simplification was that I noticed small
> > inefficiency in the way you do the compaction. In particular, I think it's not
> > always necessary to swap the tail and head entries. Would something like this
> > make sense?
> 
> I'm not sure, but I suppose that it is rare that all of the first
> many elements in the array are not COMPLETE. In most cases the
> first element gets a response first.
...
> Yeah, but maybe the "head" is still confusing even if reversed
> because it is still not a head of something.  It might be less
> confusing by rewriting it in more verbose-but-straightforwad way.
> 
> 
> |      int npending = 0;
> | 
> |      /* Skip over not-completed items at the beginning */
> |      while (npending < estate->es_num_pending_async &&
> |             estate->es_pending_async[npending] != ASYNCREQ_COMPLETE)
> |        npending++;
> | 
> |      /* Scan over the rest for not-completed items */
> |      for (i = npending + 1 ; i < estate->es_num_pending_async; ++i)
> |      {
> |        PendingAsyncRequest *tmp;
> |        PendingAsyncRequest *curr = estate->es_pending_async[i];
> |
> |        if (curr->state == ASYNCREQ_COMPLETE)
> |          continue;
> |
> |     /* Move the not-completed item to the tail of the first chunk */
> |        tmp = estate->es_pending_async[i];
> |        estate->es_pending_async[nepending] = tmp;
> |        estate->es_pending_async[i] = tmp;
> |        ++npending;
> |      }

The last patch does something like this (with apparent bugs
fixed)

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Oleg Bartunov
Дата:
Сообщение: Re: [HACKERS] [PATCH] Pageinspect - add functions on GIN and GiSTindexes from gevel
Следующее
От: Rajkumar Raghuwanshi
Дата:
Сообщение: Re: [HACKERS] UPDATE of partition key