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

Feb 27, 2006 2 Replies

============= INTEGRITY RTOS =============



Here is fragment of a program that produces error.



Two task are to be created, both are using the same entry point function.



The second task is not created.



Is there something wrong in this program?


====== Fragments of program ======



void CheckError(Error error) { if (error == Success) return;



cerr


Here is a new experiment.

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?

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

#include #include #include #include #include using namespace std;

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

static Semaphore sem;

struct Data { char* m_pValue; int m_iValue; Data(char * i_pValue = 0, int i_iValue = 0) : m_pValue (i_pValue), m_iValue (i_iValue) {} };

void CheckError(Error i_Error) { if (i_Error == Success) return;

cerr

[snip]

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

// ------ With default MemoryRegionPool ------

// -------------------------------------------

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

[snip]

[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

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required