Re: What happens if I create new threads from within a postgresql function?

From: Seref Arikan <serefarikan(at)kurumsalteknoloji(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: What happens if I create new threads from within a postgresql function?
Date: 2013-02-18 15:08:26
Message-ID: CA+4ThdpT7bj+q3sx1i2s+YMe8fYbbUvdDQ8Amj+X7J6CF4JOPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks,
You are right, it is not what I'm doing, I'm simply calling code that works
on the binary blob using multiple threads.

On Mon, Feb 18, 2013 at 3:02 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Mon, Feb 18, 2013 at 02:51:13PM +0000, Seref Arikan wrote:
> > Thanks Bruce,
> > I too think that it should be fine, as long as I make sure that the
> spawned
> > threads do not call back to originating thread and they are properly
> terminated
> > once they're finished etc.
> > Various messages I've seen in the list archives seem to mention that
> spawning
> > threads is a bad idea, etc etc. I just could not find a technical
> discussion of
> > why this is a bad idea. Maybe I have failed to generate the correct
> search
> > terms.
> > It would be great to know why and when this would be a dangerous thing
> to do.
>
> The problem comes with calling Postgres subsystems from multiple
> threads, which it doesn't sound like you are doing.
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + It's impossible for everything to be true. +
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2013-02-18 15:48:48 Re: Immutable functions, Exceptions and the Query Optimizer
Previous Message Bruce Momjian 2013-02-18 15:02:58 Re: What happens if I create new threads from within a postgresql function?