It looks from here like there can be no standard way
to do this. We use also the i386 SwiftX on our PC/104
board and it has RELATIVE jumps to next task. So it
would seem that the layout of the task area and the
code to do the task switch are very unique to each
processor (which is as it should be, no?).
But as the task memory is statically allocated and the
cost of a halted task is so small, this seems like not
such a good idea. If it were, we would expect to see
UNBUILD supplied right there along with build. Its
absence is meaningful.
If you are really in the squeeze for memory, you can
cut the amount allocated for your tasks. The amounts
allocated by default in the kernel are somewhat
generous. But do so with caution.
--- Ron Oliver <roliver_at_openesque.com> a écrit :
> 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
>
----------------------------------------------------------------------
>
>
Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail sur http://fr.mail.yahoo.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 - 08:22:15 PST
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 08-Feb-2012. Archive updated nightly.