[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so
From: |
Samuel Thibault |
Subject: |
Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so |
Date: |
Wed, 15 Sep 2021 01:27:00 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Hello,
Sergey Bugaev, le mar. 07 sept. 2021 16:33:22 +0300, a ecrit:
> diff --git a/htl/Versions b/htl/Versions
> index 4aea321016..4e0ebac285 100644
> --- a/htl/Versions
> +++ b/htl/Versions
> @@ -132,25 +122,25 @@ __pthread_alloc (struct __pthread **pthread)
> }
>
> retry:
> - __pthread_rwlock_wrlock (&__pthread_threads_lock);
> + lll_lock (GL (dl_pthread_threads_lock), LLL_PRIVATE);
Please rather use __libc_rwlock_wrlock etc.
Even if for now they are actually locks and not rwlocks, the day we fix
that the rwlocking of dl_pthread_threads_lock will get fixed alongside.
> - /* Store a pointer to this thread in the thread ID lookup table. We
> - could use __thread_setid, however, we only lock for reading as no
> - other thread should be using this entry (we also assume that the
> - store is atomic). */
> - __pthread_rwlock_rdlock (&__pthread_threads_lock);
> - __pthread_threads[pthread->thread - 1] = pthread;
> - __pthread_rwlock_unlock (&__pthread_threads_lock);
> + /* Store a pointer to this thread in the thread ID lookup table. */
> + __pthread_setid (pthread->thread, pthread);
We still want to optimize for read-lock.
Apart from this it looks good, thanks!
Samuel
- [PATCH htl v3 0/5] Rewrite THREAD_GSCOPE, Sergey Bugaev, 2021/09/07
- [PATCH htl v3 2/5] htl: Move thread table to ld.so, Sergey Bugaev, 2021/09/07
- Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so,
Samuel Thibault <=
- Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so, Sergey Bugaev, 2021/09/15
- Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so, Samuel Thibault, 2021/09/15
- Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so, Samuel Thibault, 2021/09/15
- Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so, Sergey Bugaev, 2021/09/15
- Re: [PATCH htl v3 2/5] htl: Move thread table to ld.so, Samuel Thibault, 2021/09/15
[PATCH htl v3 4/5] elf: Remove THREAD_GSCOPE_IN_TCB, Sergey Bugaev, 2021/09/07
[PATCH htl v3 3/5] htl: Reimplement GSCOPE, Sergey Bugaev, 2021/09/07
[PATCH htl v3 5/5] testrun.sh: Add support for --tool=rpctrace, Sergey Bugaev, 2021/09/07