Re: libpq and multi-threading

Поиск
Список
Период
Сортировка
От Geoff Winkless
Тема Re: libpq and multi-threading
Дата
Msg-id CAEzk6ffV0HLKPBygzaSi+iD8EN15wETnXtCwMGPJqQehKo+rBQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: libpq and multi-threading  ("Michael J. Baars" <mjbaars1977.pgsql.hackers@gmail.com>)
Список pgsql-general
On Wed, 3 May 2023 at 12:11, Michael J. Baars <mjbaars1977.pgsql.hackers@gmail.com> wrote:
The shared common address space is controlled by the clone(2) CLONE_VM option. Indeed this results in an environment in which both the parent and the child can read / write each other's memory, but dynamic memory being allocated using malloc(3) from two different threads simulaneously will result in internal interference. 

There's an interesting note here


TL;DR: glibc malloc does not cope well with threads created with clone(). Use pthread_create if you wish to use glibc malloc.

Geoff

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

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: libpq and multi-threading
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: iso-8859-1 postgres ssl error "could not accept SSL connection: Success" and timeout