Experimental Physics and
| |||||||||||||||
|
To play devil's advocate........ Does anyone know what happens in VxWorks if the C++ "new" operator throws an unhandled exception if there is insufficient heap space? *If* it suspends the task, then taskwd will work in an intuitive fashion. *If*, however, the task exits, then (it sounds like) it will escape the notice of taskwd. In the latter case, or in any case where a library function might call "exit()", then taskwd ought to check for a missing task and treat it the same as a suspended task. Alternatively, all code under taskwd supervision must handle all exceptions, and never use library functions which might call "exit" (a fairly tall order). As Kay says, if a monitored task *decides* to exit, it should intentionally unregister itself. Under those rules, there seems little harm in taskwd checking for missing tasks as well as suspended tasks (as Dave T. suggested). -- Larry P.S. I now know the answer to my hypothetical, at least for the SNS VxWorks kernel. The task is suspended (so taskwd works properly). Try this code to see what happens in your O/S: #include <ostream.h> // cout extern "C" void newTest(void){ // ask for too much memory char *tooBig = new char[(1<<24)]; // do we get here? cout << "Value of tooBig is: " << (unsigned long) tooBig << endl; }
| ||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |