Subject:
|
Re: signals / legOS internals
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Sat, 26 Jun 1999 20:13:47 GMT
|
Viewed:
|
1270 times
|
| |
| |
On Sat, 26 Jun 1999, Kekoa Proudfoot wrote:
> What am I missing? Why do you need callbacks in the process structure? I
> was thinking if you can reference the thread, you can just call a system
> function (e.g. suspend(thread)), and that will suspend the thread. You do
> not need callbacks anywhere to do this; suspend(thread) just removes the
> specified thread from whatever queue it is waiting on and puts it on a
> suspended list.
>
> Or maybe you want signals because you do not want the thread to be
> suspended immediately, but you want the thread to be able to recognize that
> some other thread wants it to suspend itself, and take action accordingly
> (so maybe it can free locks or something)? In that case, you are right,
> you need signals to do that.
Now keep in mind that this is coming from someone who won't take Duke's OS
class until next spring- is there any reason the current semaphore
implementation couldn't be used for a large percentage of these tasks?
I.E., thread A checks (or uses a wait_event to check) a semaphore before
taking an action, and thread B can toggle said semaphore to "signal"
thread A that it is appropriate to take the action. Obviously, this won't
cover all situations (it won't immediately interrupt thread A under some
circumstances, for example). However, it would seem to this untutored eye
that it would cover most of them. Am I correct? Or is there some
reason why it is inappropriate to use semaphores like this?
Mostly curious-
Luis
#######################################################################
Profanity is the one language that all programmers understand.
-Anonymous
#######################################################################
|
|
Message has 1 Reply: | | Re: signals / legOS internals
|
| (...) They could. In fact, there may be cases where that is exactly what you want to do. However, that requires you to write your code to examine the semaphore at every point where you would want to consider processing the event. It is more work. (...) (25 years ago, 26-Jun-99, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: signals / legOS internals
|
| (...) What am I missing? Why do you need callbacks in the process structure? I was thinking if you can reference the thread, you can just call a system function (e.g. suspend(thread)), and that will suspend the thread. You do not need callbacks (...) (25 years ago, 26-Jun-99, to lugnet.robotics.rcx.legos)
|
32 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|