|
On Sat, 19 Jan 2002, Michael Obenland wrote:
> I get the "0", no further counting for some minutes. So I think that in
> this situation, main indeed gets no more time slices.
I recall that legOS's priority model is pretty rigid. If a thread with a
higher priority never yields, threads with lower priority will never get
any time.
When I write legOS programs, I generally just have everything run at
PRIO_NORMAL. That way I get the multitasking behavior I expect; I yield
when I can, don't worry about it when I can't, and everything gets time. I
generally make things so that most compute-intensive tasks finish very
quickly, and any long-term ones are only one at a time, but it never
hurts to be careful.
--
"From now on, we live in a world where man has walked on the moon.
And it's not a miracle, we just decided to go." -- Jim Lovell
Mike Ash - <http://www.mikeash.com/>, <mailto:mail@mikeash.com>
|
|
Message is in Reply To:
| | Re: More on threads
|
| (...) Digging through tm.c gave me the impression, that main will indeed get no time slice. So I wrote another test program: ---...--- #include <conio.h> #include <unistd.h> pid_t worker; int work_task(int argc, char *argv[]); int main() { int i; i (...) (23 years ago, 19-Jan-02, to lugnet.robotics.rcx.legos)
|
18 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|