X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1D241D6E2A; Fri, 4 Nov 2005 14:14:39 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 06398-07; Fri, 4 Nov 2005 18:14:36 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9F017D680B; Fri, 4 Nov 2005 14:14:36 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jA4IEa0U016057; Fri, 4 Nov 2005 13:14:36 -0500 (EST) To: "Merlin Moncure" Cc: pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org Subject: Re: insert performance for win32 In-reply-to: <6EE64EF3AB31D5448D0007DD34EEB3417DD7D5@Herge.rcsinc.local> References: <6EE64EF3AB31D5448D0007DD34EEB3417DD7D5@Herge.rcsinc.local> Comments: In-reply-to "Merlin Moncure" message dated "Fri, 04 Nov 2005 13:07:24 -0500" Date: Fri, 04 Nov 2005 13:14:36 -0500 Message-ID: <16056.1131128076@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.006 required=5 tests=[AWL=0.006] X-Spam-Score: 0.006 X-Spam-Level: X-Archive-Number: 200511/88 X-Sequence-Number: 15345 "Merlin Moncure" writes: >> AFAICS it is appropriate to move the sigsetjmp and >> setup_cancel_handler >> calls in front of the per-line loop inside MainLoop --- can anyone see >> a reason not to? > hm. mainloop is re-entrant, right? That means each \i would reset the > handler...what is downside to keeping global flag? Ah, right, and in fact I'd missed the comment at line 325 pointing out that we're relying on the sigsetjmp to be re-executed every time through. That could be improved on, likely, but not right before a release. Does the flag need to be global? I'm thinking void setup_cancel_handler(void) { + static bool done = false; + + if (!done) SetConsoleCtrlHandler(consoleHandler, TRUE); + done = true; } regards, tom lane