[PATCH v2] linux: Do not spawn a new thread for SIGEV_THREAD (BZ 30558, 27895, 29705, 32833)
Florian Weimer
fweimer@redhat.com
Tue Apr 8 09:30:42 GMT 2025
* Adhemerval Zanella Netto:
> On 07/04/25 15:30, Florian Weimer wrote:
>> * Adhemerval Zanella Netto:
>>
>>> So I am not sure this really help here, it would require to add the
>>> SIGEV_THREAD on pthread_create including the sigwaitinfo, the state
>>> synchronization (including the pthread barrier) and the timeid
>>> handling. And I don't think this is the best place to add this logic.
>>>
>>> I think it would be better to move the timer_helper_thread_cleanup to
>>> pthread_create.c with a different name (__pthread_reset_state or something
>>> like that).
>>
>> What about just adding the loop on the pthread_create side?
>
> The loops only make sense for SIGEV_THREAD, where it calls sigwaitinfo
> and calls the provided callback. Moving to pthread_create will also
> require to add another hook to call INTERNAL_SYSCALL_CALL (timer_delete, ...)
> on thread exit (and also expose how POSIX timers mask out timerid).
>
> I really don't think this simplifies the code here.
Okay, please post a version with __pthread_reset_state then.
Thanks,
Florian
More information about the Libc-alpha
mailing list