-
Notifications
You must be signed in to change notification settings - Fork 26
Fiber Threads
David Schmenk edited this page Feb 28, 2023
·
11 revisions
Fibers are non-preemptive threads. They can be used for co-routines or event-driven applications. The fibers do have some limitations: their frame stack is limited to 256 total, and their hardware stack is limited to a size of $C0. So no deep recursion with fibers. Also look at Long Jump for a slightly different take on a similar theme.
TODO: Finish header file implementation
Compatibility: 1, II, ///
Usage: include "inc/fiber.plh"
Values:
byte fbrCount
Functions:
fbrInit(numPool)
fbrStop(fid)#0
fbrExit()#0
fbrStart(defaddr, param)
fbrYield()#0
fbrHalt()#0
fbrResume(fid)#0
Source Code: fiber.pla
Sample Source: fiber.pla