[M3devel] coping with low memory/resources?

Jay jay.krell at cornell.edu
Wed Apr 29 14:27:48 CEST 2009


coping with low memory/resources?
 

We have code that does like
r := pthread_do_something()
assert(r == 0);
 

where for example:
[EAGAIN]
The system lacked the necessary resources (other than memory) to initialise another mutex. 
[ENOMEM]
Insufficient memory exists to initialise the mutex. 
 
 
I'll fix it to raise an out of memory exception for ENOMEM. Ok.
But what about EAGAIN?
Retry? That is what "again" means, right?
In an infinite loop?
Or just a few times?
  You know -- overall system might be low but other parts might reduce,
  or the Modula-3 code itself might be hogging resources and retry might
  just sit there forever.
Raise some other exception?

For now I'll leave it asserting.
 

 - Jay


More information about the M3devel mailing list