Re: <INTEGRITY RTOS> Error "ObjectTableIsFull" while CreateProtectedTask()



Alex Vinokur wrote:

[snip]

A program below
* works fine with STACK_SIZE=0x2000
* produces Error-44 (NoPagesOnFreeList)
* produces Error-3 (ObjectTableIsFull)


How should we manage memory resources in order to get programs working
fine?


A stack of size StackSize while CreateProtectedTask() is allocated from
the AddressSpace's default MemoryRegionPool.



------ foo.cc ------

#include <INTEGRITY.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <util/error_string.h>
using namespace std;

// ------ With default MemoryRegionPool ------
#define STACK_SIZE 0x2000 // OK
// #define STACK_SIZE 0x5000 // IntegrityError = 44: NoPagesOnFreeList
// #define STACK_SIZE 0x7000 // IntegrityError = 3: ObjectTableIsFull
// -------------------------------------------

// ------ MemoryPoolSize = 0x200000 ------
// MemoryPoolSize 0x200000 has been set in Integrate file (foo.int)
#define STACK_SIZE 0x7000 // Works OK
// ---------------------------------------


[snip]

for (size_t i = 0; i < NUMBER_OF_TASKS; i++)
{
CheckError (CreateProtectedTask(1, (Address)task, STACK_SIZE,
taskName[i], &children[i]));

[snip

}

[snip]

Nevertheless, there is some question.
CreateProtectedTask() returns Success or ErrorCode.
Two of ErrorCode's are as follows:
1) ResourceNotAvailable: There is not a region of the desired size in
the MemoryRegionPool.
2) MemoryPoolExhausted: There is not sufficient AddressSpace heap
memory available for temporary storage and MemoryRegionPool accounting
data.

It seems that CreateProtectedTask() should return one of those
ErrorCode's in case if StackSize passed to CreateProtectedTask() and
MemoryPoolSize are inconsistent.(?)


---
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn

.