#2752 closed enhancement (fixed)

Relax execution enviroment for thread begin extensions

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: high Milestone: 5.1
Component: score Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:


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.

Change History (5)

comment:1 Changed on Jul 25, 2016 at 6:40:43 AM by Sebastian Huber <sebastian.huber@…>

In 0fd6f25507fbea5f4892b71b58837cdda17856b4/rtems:

score: Relax thread begin extension environment

Update #2752.

comment:2 Changed on Dec 23, 2016 at 2:10:09 PM by Sebastian Huber

Priority: normalhigh

comment:3 Changed on Jan 27, 2017 at 6:25:20 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

comment:4 Changed on May 11, 2017 at 7:31:02 AM by Sebastian Huber


comment:5 Changed on Nov 9, 2017 at 6:27:14 AM by Sebastian Huber


Milestone renamed

Note: See TracTickets for help on using tickets.