Re: Threading in BGWorkers (!)

From: James Sewell <james(dot)sewell(at)jirotech(dot)com>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Threading in BGWorkers (!)
Date: 2020-06-23 07:18:35
Message-ID: CAANVwEuDmX1EcfmwRtuzD3wJsHySSqvRvXfwZraG3toWsVdQMA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 23 Jun 2020 at 17:15, James Sewell <james(dot)sewell(at)jirotech(dot)com>
wrote:

> Using multithreading in bgworker is possible if you do not use any
>> Postgres runtime inside thread procedures or do it in exclusive critical
>> section.
>> It is not so convenient but possible. The most difficult thing from my
>> point of view is error reporting.
>>
>
> Happy to be proved wrong, but I don't think this is correct.
>
> PostgreSQL can call sigprocmask() in your BGWorker whenever it wants, and
> "The use of sigprocmask() is unspecified in a multithreaded process" [1]
>
> [1] https://pubs.opengroup.org/onlinepubs/9699919799/
>

Sorry link should be [1]
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigprocmask.html

--
The contents of this email are confidential and may be subject to legal or
professional privilege and copyright. No representation is made that this
email is free of viruses or other defects. If you have received this
communication in error, you may not copy or distribute any part of it or
otherwise disclose its contents to anyone. Please advise the sender of your
incorrect receipt of this correspondence.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2020-06-23 07:26:16 Re: Threading in BGWorkers (!)
Previous Message James Sewell 2020-06-23 07:15:38 Re: Threading in BGWorkers (!)