public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Nick Garnett <nickg@cygnus.co.uk>
To: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] about Per Thread Data
Date: Fri, 06 Oct 2000 05:15:00 -0000	[thread overview]
Message-ID: <wwgya038bqm.fsf@host38.cygnus> (raw)
In-Reply-To: <8AE4B526B977D411841F00A0CC334020052C7B@cuz-exchange.sdesigns.net>

Fabrice Gautier <Fabrice_Gautier@sdesigns.com> writes:

> Hi,
> 
> Is it possible to use per thread data statically. 
> 
> I mean I would like to always keep the same information at index 0. So can I
> safely bypass "cyg_thread_new_data_index" and "cyg_thread_free_data_index" ?
> 

This is not really a good idea. To start: indexes 0..3 are reserved
for various packages. If you avoid ever using
cyg_thread_new_data_index() then you should start working from offset
4. However, beware that other packages than may need per thread data
will still be expecting you to to be playing the game, and may get
the static index you are using allocated to them. There are also
assertions in the access functions that check that the supplied index
is valid.

Perhaps the best approach is to use cyg_thread_new_data_index(), check
that the result is 4, and then use 4 statically throughout. This would
also allow the assertions in the access functions to pass. 

-- 
Nick Garnett, eCos Kernel Architect
Red Hat, Cambridge, UK

      reply	other threads:[~2000-10-06  5:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-29 23:12 Fabrice Gautier
2000-10-06  5:15 ` Nick Garnett [this message]

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=wwgya038bqm.fsf@host38.cygnus \
    --to=nickg@cygnus.co.uk \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).