To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.pbforthOpen lugnet.robotics.rcx.pbforth in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / pbFORTH / 303
302  |  304
Subject: 
RE: Multitasking questions
Newsgroups: 
lugnet.robotics.rcx.pbforth
Date: 
Wed, 3 May 2000 18:06:47 GMT
Viewed: 
1390 times
  
1) scripts/muldemo.txt uses the word HAT instead
of ALLOT_TASK. Does HAT actually exist or is this
left over from hforth.

Ummm, I'm in the process of verifying all of the old
scripts I package with pbForth. It looks like HAT
is what actually works, and I've managed to change the
documentation and not the code.

HAT is in the origianl hForth implementation but I
didn't like it because I couldn't figure out
what HAT meant!!! Any ideas? Would you prefer ALLOT_TASK

2) Tasking by convention? When do tasks switch?
PAUSE obviously. Does AWAKE actually context
switch or only mark the task as runable. Anywhere
else? SLEEP? What happens if you SLEEP yourself?
A reschedule? Or does it only become effective
after the next PAUSE?

Tasks switch when they PAUSE. Any task can control the AWAKE or
SLEEP state of any other task. It's not as safe or bullet proof as
Windows...yeah right.

You must first create each task, and then make it runnable
by AWAKEing it. When a task executes PAUSE, it "gives up" the processor
so the next AWAKE task in the list runs. It's really a cooperative
round-robin scheduler.

AWAKE marks the task runnable, SLEEP marks it as, well, asleep.
I think if you SLEEP yourself you keep running until you PAUSE,
and then you have to hope some other task AWAKEs you.

3) I assume the scheduling is round robin. The
order must be controlled by BUILD? Probably
new tasks go in after the current one?

The order is controlled by the order of the BUILD.

Please keep banging on the tasker. It's a neat feature. I guess
I could make the IR comms buffered....

Cheers,

Ralph Hempel - P.Eng

--------------------------------------------------------
Check out pbFORTH for LEGO Mindstorms at:
<http://www.hempeldesigngroup.com/lego/pbFORTH>
--------------------------------------------------------
Reply to:      rhempel at bmts dot com
--------------------------------------------------------



Message has 1 Reply:
  Banging on the tasker
 
(...) That's my plan. The nice thing about the tasker is that people can write code in a format they are more used to. The same things can be done with event driven single task code but it inverts the control flow. It is more meaningful for most (...) (25 years ago, 3-May-00, to lugnet.robotics.rcx.pbforth)

Message is in Reply To:
  Multitasking questions
 
1) scripts/muldemo.txt uses the word HAT instead of ALLOT_TASK. Does HAT actually exist or is this left over from hforth. 2) Tasking by convention? When do tasks switch? PAUSE obviously. Does AWAKE actually context switch or only mark the task as (...) (25 years ago, 3-May-00, to lugnet.robotics.rcx.pbforth)

6 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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR