parallel dump/restore code on WIndows

Lists: pgsql-hackers
From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Joachim Wieland <joe(at)mcknight(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: parallel dump/restore code on WIndows
Date: 2012-04-06 00:12:53
Message-ID: 4F7E3505.3030100@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Why was this code:

#ifdef WIN32
if (parallel_init_done && GetCurrentThreadId() != mainThreadId)
ExitThread(code);
#endif

removed from dumputils.c by commit
5e86c61a7eec0fdc6961493a150159fa8fc63b1c? The commit message doesn't
refer to it at all.

I don't understand it at all, and there is nothing in Joachim's latest
patch that would call ExitThread() from an exit handler, so the effect
seems likely to me to break parallel windows processing in nasty ways if
called from a worker thread, although I haven't tested it.

cheers

andrew


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Joachim Wieland <joe(at)mcknight(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: parallel dump/restore code on WIndows
Date: 2012-04-06 01:27:31
Message-ID: CA+TgmoYmgN38oCUF-D9XAzSuGmNBkmTMoLF_cQK27fqGYVevvw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Apr 5, 2012 at 8:12 PM, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> Why was this code:
>
>   #ifdef WIN32
>       if (parallel_init_done && GetCurrentThreadId() != mainThreadId)
>           ExitThread(code);
>   #endif
>
>
> removed from dumputils.c by commit 5e86c61a7eec0fdc6961493a150159fa8fc63b1c?
> The commit message doesn't refer to it at all.
>
> I don't understand it at all, and there is nothing in Joachim's latest patch
> that would call ExitThread() from an exit handler, so the effect seems
> likely to me to break parallel windows processing in nasty ways if called
> from a worker thread, although I haven't tested it.

Ah, snap. That's a mistake on my part. Sorry.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company