| От | Thomas Hallgren |
|---|---|
| Тема | Question regarding pfree and thread safety. |
| Дата | |
| Msg-id | bu84oo$f42$1@news.hub.org обсуждение исходный текст |
| Ответы |
Re: Question regarding pfree and thread safety.
|
| Список | pgsql-hackers |
Is it safe to call pfree() from multiple threads? My Java backend will need to utilize finalizers. Objects like a saved execution plan that has been "forgotten" must be released when the wrapping Java object is finalized to avoid memory leaks. The finalizer is called from the garbage collector which in turn might run in a separate thread. I have two choices: 1. Let finalizers put pfree() candiates on a "death row" and let each call from SQL into my call manager pfree() the candidates found there. All "death row" management is of course subject to a mutex. 2. Let the finalizer call pfree directly and trust that it is thread safe. Advice is greatly appreciated. - thomas
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера