Experimental Physics and Industrial Control System
On Apr 13, 2005, at 18:32, Thompson, David H. wrote:
As I understand it, taskwd, is supposed to monitor registered tasks so
that when one of them gets unexpectedly into a suspended state some
action can be taken. In our case, taskwd was suspended and no other
task appeared in the list as suspended. Looking at source code, I see
that on vxWorks the taskwd main loop calls epicsThreadIsSuspended()
which in turn calls taskIsSuspended() in the vxWorks kernel. Looking
there, to see if there might be a cause for the bus error, I noticed
that the logic of the routine might not match the semantics that the
taskwd is expecting.
Here is the problem, if the task is suspended, the function returns
TRUE to taskwd, if the task is not suspended or is non-existent,
deleted, the function returns FALSE.
Seems to me that taskwd would want to know the difference between
“running” and “dead”. Maybe the loss of connectivity lies in a dead
task that no longer shows up in the task list.
To the defense of taskwd:
In Theory, a task that registers with taskwd should be either running -
in which case all is fine,
or suspended - in which case taskIsSuspended() == TRUE
and taskwd can print a message.
If a monitored task decides to exit, it's supposed
to remove its registration with taskwd.
In Reality, however, we can run into a case where
a monitored task quits because of a problem without
properly un-registering.
Unclear to me how bullet-proof taskwd must be to handle all
eventualities:
Check if a registered task ID is still valid, still running,
still associated with the task that originally registered
- since that one might have quit and now we're looking at
a completely different task that just happens to have the same ID?
Bottom line is that taskwd works best when you only write
perfect code that never requires the help of a task watchdog ;-)
-Kay
- Replies:
- Re: Possible bug in taskwd Hoff, Lawrence
- References:
- Possible bug in taskwd Thompson, David H.
- Navigate by Date:
- Prev:
RE: CA; ca_context_destoy and CA channels Liyu, Andrei
- Next:
Re: Possible bug in taskwd Hoff, Lawrence
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Possible bug in taskwd Thompson, David H.
- Next:
Re: Possible bug in taskwd Hoff, Lawrence
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
<2005>
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024