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

Joerg Sonnenberger <> 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 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.

--- syncop.c.orig
+++ syncop.c
@@ -290,8 +293,17 @@
         THIS = task->xl;
         task->woken = 0;
         task->slept = 0;
+#ifdef __NetBSD__
+#if defined(_UC_TLSBASE)
+        task->ctx.uc_flags &= ~_UC_TLSBASE;
+#elif defined(_UC_UNIQUE) /* For alpha */
+        task->ctx.uc_flags &= ~_UC_UNIQUE;
+#elif !defined(__powerpc__)
+        #error "Your NetBSD port cannot mix swapcontext and pthread"
+#endif /* __NetBSD __ */
         if (swapcontext (&task->proc->sched, &task->ctx) < 0) {
                 gf_log ("syncop", GF_LOG_ERROR,
                         "swapcontext failed (%s)", strerror (errno));

Emmanuel Dreyfus

Home | Main Index | Thread Index | Old Index