tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [RFC][PATCH] _UC_TLSBASE for all ports



On Sat, Aug 11, 2012 at 03:37:05AM +0200, Emmanuel Dreyfus wrote:
> Joerg Sonnenberger <joerg%britannica.bec.de@localhost> wrote:
> 
> > I don't agree with it being a nasty bug. Heck, document it as limitation
> > if you want. But essentially don't mix *context and pthread in this way,
> > it will create other interesting issues later.
> 
> Ok, so here is my point of view:
> - we allow mixing swapcontext and pthread in a way that procude a bug

We always allowed it. In netbsd-5 it is plainly broken. Your point?

> - we have _UC_TLSBASE  on most ports that allow doing it without the bug
> - I propose adding _UC_TLSBASE for ports that miss it
> 
> Are you really going to oppose making a MD feature available on all
> ports with the same interface because you dislike it being used? We are
> not going to make the glusterfs guys rewriting their code, they seems to
> be happy with it. If my patch is rejected, I will have contribute a
> change to glusterfs like below. That looks like a shameful mess.

Yes, I dislike it being used, because it breaks perfectly valid
assumptions like lwpid being constant across the life time of a thread.
There are essentially two reasons why *context existed in the past:
(1) Allow pure userland thread libraries to be created in a
semi-portable fashion.
(2) Allow a basic fallback path for co-routine libraries.

The first part works perfectly fine. The second continues to work as
long as you stay within the same thread and didn't work before. It can
be implemented just as well on top of pthread using a CV. *context is no
proper implementation for co-routines as I already mentioned, use a
proper library for them.

Joerg


Home | Main Index | Thread Index | Old Index