[RTEMS Project] #2752: Relax execution enviroment for thread begin extensions
RTEMS trac
trac at rtems.org
Mon Jul 4 11:58:12 UTC 2016
#2752: Relax execution enviroment for thread begin extensions
-----------------------------+-----------------------------
Reporter: sebastian.huber | Owner: sebastian.huber
Type: enhancement | Status: new
Priority: normal | Milestone: 4.12
Component: cpukit | Version: 4.10
Severity: normal | Keywords:
-----------------------------+-----------------------------
Currently, the thread begin extensions are invoked with thread dispatching
disabled. There is an explanation for this in the code
{{{
/*
* Take care that 'begin' extensions get to complete before
* 'switch' extensions can run. This means must keep dispatch
* disabled until all 'begin' extensions complete.
*/
_User_extensions_Thread_begin( executing );
}}}
However, the switch extension is always invoked before the thread begin
extension for all threads except the initialization thread. A thread
dispatch disabled contexts drastically limits the work which can be
carried out in the thread begin extensions. It is for example not
possible to call malloc(), create POSIX keys or access C++ thread local
storage.
The thread begin extension should execute in a normal thread context.
Thread begin extensions that are disturbed by a thread dispatch should
deal with this locally.
With the availability of C++ thread local storage in RTEMS being able to
pre-initialize such objects in the thread begin extension would be quite
handy.
--
Ticket URL: <http://devel.rtems.org/ticket/2752>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list