public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] about Per Thread Data
@ 2000-09-29 23:12 Fabrice Gautier
  2000-10-06  5:15 ` Nick Garnett
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Gautier @ 2000-09-29 23:12 UTC (permalink / raw)
  To: Ecos-List (E-mail)

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" ?

Thanks

-- 
Fabrice Gautier
fabrice_gautier@sdesigns.com 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] about Per Thread Data
  2000-09-29 23:12 [ECOS] about Per Thread Data Fabrice Gautier
@ 2000-10-06  5:15 ` Nick Garnett
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Garnett @ 2000-10-06  5:15 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-10-06  5:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-29 23:12 [ECOS] about Per Thread Data Fabrice Gautier
2000-10-06  5:15 ` Nick Garnett

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