RE: WL_SOCKET_ACCEPT fairness on Windows

Поиск
Список
Период
Сортировка
От Wei Wang (Fujitsu)
Тема RE: WL_SOCKET_ACCEPT fairness on Windows
Дата
Msg-id OS3PR01MB6275CD8E0EB93489054AB4659E7F9@OS3PR01MB6275.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: WL_SOCKET_ACCEPT fairness on Windows  (Thomas Munro <thomas.munro@gmail.com>)
Ответы Re: WL_SOCKET_ACCEPT fairness on Windows  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On Sat, April 1, 2023 at 11:00 AM Thomas Munro <thomas.munro@gmail.com> wrote:
>
Hi,
Thanks for your patch.

I tried to test this patch on Windows. And I did cover the new code path below:
```
+        /* We have another event to decode. */
+        cur_event = &set->events[next_pos + (rc - WAIT_OBJECT_0)];
```

But I have one thing want to confirm:
In my tests, I think the scenario with two different events (e.g., one ending
socket connection and one incoming socket connection) has been optimized.
However, it seems that when there are multiple incoming socket connections, the
function WaitEventSetWaitBlock is called multiple times instead of being called
once. Is this our expected result?

Here are my test details:
I use the debugger to ensure that multiple events occur when the function
WaitEventSetWaitBlock is called. First, I added a breakpoint in the below code:
```
        /*
        * Sleep.
        *
        * Need to wait for ->nevents + 1, because signal handle is in [0].
        */
b        rc = WaitForMultipleObjects(set->nevents + 1, set->handles, FALSE,
                                    cur_timeout);
```
And then make sure that the postmaster process enters the function
WaitForMultipleObjects. (I think the postmaster process will only return from
the function WaitForMultipleObjects when any object is signaled or timeout
occurs). Before the timeout occurs, I set up multiple socket connections using
psql (the first connection makes the process returns from the function
WaitForMultipleObjects). Then, as I continued debugging, multiple socket
connections were handled by different calls of the function
WaitEventSetWaitBlock.

Please let me know if I am missing something.

Regards,
Wang wei

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

Предыдущее
От: "Joel Jacobson"
Дата:
Сообщение: Re: Should CSV parsing be stricter about mid-field quotes?
Следующее
От: Aleksander Alekseev
Дата:
Сообщение: Re: RFI: Extending the TOAST Pointer