From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J.A. Magallon" Subject: Re: per-thread global variables Date: Fri, 12 Jul 2002 18:34:48 +0200 Sender: linux-smp-owner@vger.kernel.org Message-ID: <20020712163448.GE2348@werewolf.able.es> References: Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: ; from alan@lxorguk.ukuu.org.uk on Fri, Jul 12, 2002 at 18:43:05 +0200 List-Id: Content-Type: text/plain; charset="iso-8859-1" To: Alan Cox Cc: Lista Linux-SMP On 2002.07.12 Alan Cox wrote: >> about an __attribute(( )) in gcc. Other solutions imply a search bas= ed >> on pid, but I would like to find some more direct method. >> Something like using the PRDA in IRIX. > >If your stacks are the same size you can do the kernel trick with stac= k >maths to hide thread globals.=20 >- >To unsubscribe from this list: send the line "unsubscribe linux-smp" i= n >the body of a message to majordomo@vger.kernel.org >More majordomo info at http://vger.kernel.org/majordomo-info.html > > Uhm, something like reserving X bytes for stack, and telling clone() I pass it a X-sizeof(prda) stack ? How do I get the stack start from inside a thread ? BTW, isn't there a barrier() syscall in Linux ? I could implement it=20 with a semaphore with -N holes, but...man sem_init tially to value. The pshared argument indicates whether the semaphore is local to the current process ( pshared is zero) or is to be shared between several processes ( pshared is not zero). LinuxThreads currently does not sup=AD port process-shared semaphores, thus sem_init always returns with error ENOSYS if pshared is not zero. TIA --=20 J.A. Magallon \ Software is like sex: It's better when it= 's free mailto:jamagallon@able.es \ -- Linus Torvalds, FSF = T-shirt Linux werewolf 2.4.19-rc1-jam3, Mandrake Linux 8.3 (Cooker) for i586 gcc (GCC) 3.1.1 (Mandrake Linux 8.3 3.1.1-0.7mdk)