![]() | ||
| Home | SwiftX Archive | SwiftForth Archive | |

On Fri, 17 Dec 2004, Frank Boon [Metatronics] wrote:
> Does anybody have the inverse word of BUILD ?? e.g. to unlink a task
> from the round-bobin? nothing more?
>
> don't like to reinvent the wheel..
There's no standard SwiftX word to do it, but it's easy enough to
do. Find the FOLLOWER that points to the task you want to unlink
from the round-robin, and replace its value with the FOLLOWER value
from the task to unlink.
> purpose: flexibility, speed, memory
Unlinking a task typically just saves you one unconditional jump to
the next task vs. HALTing the task. I've done it in the past, but
looking back, I'm not really sure it was ever worth it.
Memory is allocated for the task at compile time, so unless you were
going to use its stacks or user variables for temporary storage, I
don't know what you'd gain. BUILD doesn't allocate any memory at
run-time; it just initializes the task and links it into the
round-robin.
Even if you were going to reuse the task's memory, stopping the task
would make the memory available for your fiendish purposes, as long
as you don't step on STATUS or FOLLOWER. That sounds sketchy,
though; there's probably a better way to do what you want to do.
NB: for a TERMINAL task, make sure there's no pending
interrupt-driven I/O that might awaken the stopped task! That's one
place where unlinking might save you...it doesn't matter if you
awaken a task that isn't linked into the round-robin, since the
multitasker's no longer looking at its STATUS.
-- Ron Oliver <roliver_at_openesque.com> ---------------------------------------------------------------------- swiftx_at_forth.com The SwiftX programming discussion email list To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com For list command help, send subject "help" to swiftx-request_at_forth.com Message archives are located at http://www.forth.com/archive/swiftx ---------------------------------------------------------------------- This list is a forum for SwiftX users. For product support and bug reports, please send email to support_at_forth.com ----------------------------------------------------------------------Received on Fri Dec 17 2004 - 07:54:56 PST
This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:50 PST