Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-28 Thread Junio C Hamano
Jeff Hostetler writes: > For now, I've guarded my usage of pthread_getspecific() in the trace2 > (similar to what index-pack does), so its not urgent that we update it. > And I'd rather we take this simple trace2 fix now and not try to combine > it with fixes for the pthread macros. Especially n

Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-28 Thread Jeff Hostetler
On 5/28/2019 2:28 AM, Jeff King wrote: On Sat, May 25, 2019 at 05:43:55PM +0700, Duy Nguyen wrote: +typedef struct { + void *data; + /* extra indirection because setspecific is passed key by value */ + void **vdata; Ha! I was thinking a separate key->value mapping which i

Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-27 Thread Jeff King
On Sat, May 25, 2019 at 05:43:55PM +0700, Duy Nguyen wrote: > > +typedef struct { > > + void *data; > > + /* extra indirection because setspecific is passed key by value */ > > + void **vdata; > > Ha! I was thinking a separate key->value mapping which is complicated > in C. But

Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-25 Thread Duy Nguyen
On Thu, May 23, 2019 at 12:51 PM Jeff King wrote: > For fun, here's a constant-time zero-allocation implementation that I > came up with. It passes t0211 with NO_PTHREADS, but I didn't test it > beyond that. > > diff --git a/thread-utils.h b/thread-utils.h > index 4961487ed9..f466215742 100644 > -

Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-23 Thread Jeff Hostetler
On 5/23/2019 1:51 AM, Jeff King wrote: On Wed, May 22, 2019 at 09:23:39AM -0400, Jeff Hostetler wrote: I was wondering about that too as the proper long term solution. We would need (as the discussion suggests [1]) to properly respect/represent the pthread_key_t argument. For now, I've guar

Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-22 Thread Jeff King
On Wed, May 22, 2019 at 09:23:39AM -0400, Jeff Hostetler wrote: > I was wondering about that too as the proper long term solution. > We would need (as the discussion suggests [1]) to properly > respect/represent the pthread_key_t argument. > > For now, I've guarded my usage of pthread_getspecific

Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-22 Thread Jeff Hostetler
On 5/21/2019 5:27 PM, Jeff King wrote: On Tue, May 21, 2019 at 12:33:58PM -0700, Jeff Hostetler via GitGitGadget wrote: As Duy suggested, pthread_getspecific() just returns NULL when NO_PTHREADS is defined. And pthread_setspecific() silently does not nothing. So this problem was hidden from

Re: [PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-21 Thread Jeff King
On Tue, May 21, 2019 at 12:33:58PM -0700, Jeff Hostetler via GitGitGadget wrote: > As Duy suggested, pthread_getspecific() just returns NULL when NO_PTHREADS > is defined. And pthread_setspecific() silently does not nothing. So this > problem was hidden from view. > > I have to wonder if we shoul

[PATCH 0/1] trace2: fix tracing when NO_PTHREADS is defined

2019-05-21 Thread Jeff Hostetler via GitGitGadget
This commit addresses the problem reported in: https://public-inbox.org/git/92cfdf43-8841-9c5a-7838-dda995038...@jeffhostetler.com/T/#mbaf8069f6d1bc18d5a02d3682a1f9282f5547ea9 As Duy suggested, pthread_getspecific() just returns NULL when NO_PTHREADS is defined. And pthread_setspecific() silently