Marty:
We created our own version of the subroutine record. It has an interesting
characteristic that I'd like to share with you. I was very afraid of
allowing user code to run in the context of any one of the standard scan
tasks. If they screw up, then a scan task gets suspended. This can cause
some other process to be uncontrolled and that could be either expensive
or dangerous. What we did was start another task that was somewhat similar
to the original callback task. When one of these subroutine records is
to be processed, the process routine first checks the status of the extra
task. If that task is suspended, we set a SCAN alarm condition in the
subroutine record and return. If that task is not suspended, then we give
a semaphore that will cause the subroutine task to actually run the user's
code. Another semaphore lets the record processing routine know that the
code has run to completion. We take this semaphore with an arbitrary two
tick timeout to prevent user code with an infinite loop from hanging the
scan tasks. On timeout, record support will suspend the user code task.
Two ticks is a lot of time on a 68040!
Well, enough said. This may not be a requirement in the research world, but
it certainly is in the commercial marketplace. Just because a user screws
up some code that he puts into an IOC is no excuse (in their eyes) for us
not to have protected ourselves from them. I guess the moral of the story
is that even if the whole world is actually out to get you, it doesn't mean
that you aren't paranoid.
Regards,
Gordon
,,,
(o o)
--------------------------oOO--(_)--OOo----------------------
_/_/_/_/_/_/_/ _/_/_/ _/_/_/_/_/_/_/ _/_/_/_/_/_/
_/_/ _/_/_/_/ _/_/ _/_/
_/_/ _/_/ _/_/ _/_/ _/_/
_/_/ _/_/_/_/_/_/ _/_/ _/_/_/_/_/_/
_/_/ _/_/ _/_/ _/_/ _/_/
_/_/ _/_/ _/_/ _/_/ _/_/
_/_/ _/_/ _/_/ _/_/ _/_/_/_/_/_/
INTEGRATED SYSTEMS, L.P.
-------------------------------------------------------------
Gordon M. Uchenick Phone: 410-581-0422
11431 Cronhill Drive, Suite J FAX: 410-581-5738
Owings Mills, MD 21117 EMAIL: [email protected]
"When you lose your momentum, all you have left is inertia."
----- End Included Message -----
- Navigate by Date:
- Prev:
CAN connection Gabor Csuka
- Next:
Re: Subroutine Records Marty Kraimer
- 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:
Re: CAN connection Gabor Csuka
- Next:
Re: Subroutine Records Marty Kraimer
- 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
|