Re: [Xenomai-core] [PATCH 09/12] Optionally replace pthread_getspecific with TLS variables
Jan Kiszka wrote: > Gilles Chanteperdrix wrote: >> Jan Kiszka wrote: >> >> The real downside here is a lot of #ifdef clutter. What about the idea >> of defining an API to abstract the differences between >> pthread_get/setspecific and __thread and have #ifdef only in one header ? > > Sometimes you only store a value that way, sometimes you also have to > provide the object that is stored. Then its initialisation is fairly > specific. > > Everything can be abstracted, but I'm not that optimistic that the > result will be better readable, just look at the patched users. Or what > abstractions do you have in mind? I tried, but I failed. The usage differences in the skins are to significant to define a generic per-thread wrapper that fits at least a subset of use cases. Anyway, I was at least able to eliminate two #ifdefs by converting the xeno_current_key initialization from pthread_once to a constructor function (that is under #ifdef anyway). Updates will follow. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] [PATCH 09/12] Optionally replace pthread_getspecific with TLS variables
Gilles Chanteperdrix wrote: > Jan Kiszka wrote: > > The real downside here is a lot of #ifdef clutter. What about the idea > of defining an API to abstract the differences between > pthread_get/setspecific and __thread and have #ifdef only in one header ? Sometimes you only store a value that way, sometimes you also have to provide the object that is stored. Then its initialisation is fairly specific. Everything can be abstracted, but I'm not that optimistic that the result will be better readable, just look at the patched users. Or what abstractions do you have in mind? Jan signature.asc Description: OpenPGP digital signature ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] [PATCH 09/12] Optionally replace pthread_getspecific with TLS variables
Jan Kiszka wrote: The real downside here is a lot of #ifdef clutter. What about the idea of defining an API to abstract the differences between pthread_get/setspecific and __thread and have #ifdef only in one header ? -- Gilles. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core