Symmetric Multiprocessing (SMP) development
 help / color / mirror / Atom feed
From: "J.A. Magallon" <jamagallon@able.es>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Lista Linux-SMP <linux-smp@vger.kernel.org>
Subject: Re: per-thread global variables
Date: Fri, 12 Jul 2002 18:34:48 +0200	[thread overview]
Message-ID: <20020712163448.GE2348@werewolf.able.es> (raw)
In-Reply-To: <E17T3VZ-0003Mk-00@the-village.bc.nu>; from alan@lxorguk.ukuu.org.uk on Fri, Jul 12, 2002 at 18:43:05 +0200


On 2002.07.12 Alan Cox wrote:
>> about an __attribute(( )) in gcc. Other solutions imply a search based
>> 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 stack
>maths to hide thread globals. 
>-
>To unsubscribe from this list: send the line "unsubscribe linux-smp" in
>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 
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­
       port  process-shared  semaphores,  thus  sem_init   always
       returns with error ENOSYS if pshared is not zero.


TIA

-- 
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)

  reply	other threads:[~2002-07-12 16:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-12 16:15 per-thread global variables J.A. Magallon
2002-07-12 16:43 ` Alan Cox
2002-07-12 16:34   ` J.A. Magallon [this message]
2002-07-12 17:41     ` Alan Cox
2002-07-12 19:17 ` Robert M. Hyatt
2002-07-13  0:12   ` J.A. Magallon
2002-07-13  1:50     ` Alan Cox
2002-07-13  1:11       ` J.A. Magallon
2002-07-13  2:05         ` J.A. Magallon
2002-07-13  3:20     ` Robert M. Hyatt
2002-07-13  9:43       ` J.A. Magallon
2002-07-13 14:07         ` Robert M. Hyatt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020712163448.GE2348@werewolf.able.es \
    --to=jamagallon@able.es \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-smp@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox