Subject:
|
Clarification of access control
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Thu, 16 Nov 2000 16:46:44 GMT
|
Original-From:
|
Bill Weiss <BWEISS@ASSET-nospamINTERTECH.COM>
|
Viewed:
|
573 times
|
| |
| |
I'm curently reading Extreme Mindstorms. In listing 4.2 (see below) the
seek task acquires the user defined resource and then enters an inner
infinite loop looking for a target. It appears to me that if the seek task
losing ownership of the user defined resource (because the main task has
requested ownership and it has higher priority) that is will continue
looking for the target regardless of whether is has ownership of the
resource or not. I'm I missing something?
What happens if a task loses ownership of a resource while its in the middle
of doing some work? Does the task continue, stop, start over?
task seek()
{
SetPriority(2);
while(true)
{
acquire(ACQUIRE_USER_1) <--- Will only do this once
{
Wait(SEEK_DELAY);
while(true)
{
until(EYE < threshold); <---- Will always be looking for
the target
find_target();
}
}
}
}
Bill Weiss
Senior Software Developer
ASSET InterTech, Inc.
bweiss@asset-intertech.com
|
|
Message has 1 Reply: | | Re: Clarification of access control
|
| If a task loses its resources (due to an equal or higher priority task acquiring them), then control leaves the body of the acquire statement. If there is a "catch" block following the acquire, then the catch block is executed, otherwise control (...) (24 years ago, 16-Nov-00, to lugnet.robotics)
|
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|