exit() behavior on Windows?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема exit() behavior on Windows?
Дата
Msg-id 12197.1463248291@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: exit() behavior on Windows?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Rather belatedly, I've started to look into a fix for pg_dump's
problem with error reporting in parallel mode:
http://www.postgresql.org/message-id/2458.1450894615@sss.pgh.pa.us

One of the issues here is that pg_dump uses threads not subprocesses
to do parallelism on Windows, which means that totally different
reasoning is needed for that case.  I'm looking in particular at the
use of exit().  What I gather from Microsoft's documentation is that
exit() will kill the whole process not just the calling thread ---
can anyone confirm that that's correct?  Are the other threads just
killed asynchronously, or do they get a chance to shut down?

If it's just a quick kill, then there's a totally separate bug here for
Windows.  What is likely to happen with the current coding is that a
failing child thread will queue its error message into the communication
pipe, and then exit(1), thereby killing the whole pg_dump process before
the master thread can receive and print the error.  The visible result
would be about the same as what I described on Linux, ie failure exit
with no error message reported.  But the mechanism is different.
        regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Perf Benchmarking and regression.
Следующее
От: Martín Marqués
Дата:
Сообщение: Re: 10.0