thread allocation blocked by stack size

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 3 08:11:46 UTC 2015



On 03/11/15 09:09, Sebastian Huber wrote:
>
>
> On 02/11/15 20:00, Martin Werner wrote:
>> I'm porting a linux application to rtems, and placing a set of
>> applications into rtems tasks. These tasks individually create a set of
>> threads via pthread_create().
>>
>> I'm running into issues with stack allocation, in that the second task
>> to start fails to start some of its threads with pthread_create()
>> reporting EAGAIN.
>>
>> I've dug down a bit and seen that this is fundamentally due to
>>
>> cpukit/score/src/threadstackallocate.c:38
>> stack_addr = (*stack_allocate_hook)( the_stack_size );
>>
>> getting a null stack address, which propagates upwards...
>>
>> I've experimented with tweaking task stack size argument in
>> rtems_task_create(...), and modifying the following defines in my
>> initialization:
>> CONFIGURE_EXECUTIVE_RAM_SIZE
>> CONFIGURE_MAXIMUM_TASKS
>> CONFIGURE_MAXIMUM_POSIX_THREADS
>> CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
>> CONFIGURE_MINIMUM_TASK_STACK_SIZE
>> CONFIGURE_INIT_TASK_STACK_SIZE
>> CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
>> CONFIGURE_UNIFIED_WORK_AREAS
>> CONFIGURE_UNLIMITED_OBJECTS
>> CONFIGURE_EXTRA_TASK_STACKS
>
> Use only:
>
> #define CONFIGURE_UNIFIED_WORK_AREAS
> #define CONFIGURE_UNLIMITED_OBJECTS
>
> See testsuites/samples/fileio/system.h for an example.

See also cpukit/libmisc/dummy/default-configuration.c.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the users mailing list