← Back to team overview

maria-developers team mailing list archive

Re: Joinable threads

 

Hi!

On Wed, May 4, 2016 at 11:13 AM, Sergey Vojtovich <svoj@xxxxxxxxxxx> wrote:
> Hi Monty,
>
> I vaguely recall you told me once that you like detached threads more than
> joinable, specifically for service threads. Could you remind me what were
> the reasons behind it?
>
> I need this to fix https://jira.mariadb.org/browse/MDEV-9994 properly.

The main reason is just that with joinable threads you have more work
to manage the threads as you need to remember to join them as
otherwise you will get a memory loss.

The only time the server has a benefit of join able threads, at least
as far as I am aware of it, is at shutdown, which hasn't been a real
problem as in most cases
my_thread_end() will ensure that all threads has been calling
my_thread_end() before the server dies.

Referring to the valgrind issue, I would just ignore the memory loss
for tls, as this isn't a real error.  We are already ignoring this on
other platforms.

Regards,
Monty


Follow ups

References