yield changes
parent
c15c1e3dd8
commit
b679c73096
|
@ -9,7 +9,6 @@
|
||||||
- get all-tests to run with -no-compile
|
- get all-tests to run with -no-compile
|
||||||
- if external factor is down, don't add tons of random shit to the dictionary
|
- if external factor is down, don't add tons of random shit to the dictionary
|
||||||
- scalar * matrix, vector * matrix, matrix * vector need to work
|
- scalar * matrix, vector * matrix, matrix * vector need to work
|
||||||
- turning vectors into row and column matrices
|
|
||||||
- make-matrix is slow and ugly
|
- make-matrix is slow and ugly
|
||||||
- move 2repeat somewhere else
|
- move 2repeat somewhere else
|
||||||
- rotating cube demo
|
- rotating cube demo
|
||||||
|
|
|
@ -19,13 +19,13 @@ namespaces ;
|
||||||
deque set-run-queue
|
deque set-run-queue
|
||||||
] ifte ;
|
] ifte ;
|
||||||
|
|
||||||
: schedule-thread ( quot -- ) run-queue enque set-run-queue ;
|
: schedule-thread ( quot -- )
|
||||||
|
run-queue enque set-run-queue ;
|
||||||
|
|
||||||
: stop ( -- )
|
: stop ( -- )
|
||||||
#! If there is a quotation in the run queue, call it,
|
! This definition gets replaced by the Unix and Win32 I/O
|
||||||
#! otherwise wait for I/O.
|
! code.
|
||||||
pending-io? [ 10 io-multiplex ] when
|
next-thread [ call ] [ "No more tasks" throw ] ifte* ;
|
||||||
next-thread [ call ] [ -1 io-multiplex stop ] ifte* ;
|
|
||||||
|
|
||||||
: yield ( -- )
|
: yield ( -- )
|
||||||
#! Add the current continuation to the run queue, and yield
|
#! Add the current continuation to the run queue, and yield
|
||||||
|
|
|
@ -388,3 +388,11 @@ USE: stdio
|
||||||
IN: streams
|
IN: streams
|
||||||
|
|
||||||
: fcopy 2drop ;
|
: fcopy 2drop ;
|
||||||
|
|
||||||
|
IN: threads
|
||||||
|
|
||||||
|
: stop ( -- )
|
||||||
|
#! If there is a quotation in the run queue, call it,
|
||||||
|
#! otherwise wait for I/O.
|
||||||
|
pending-io? [ 10 io-multiplex ] when
|
||||||
|
next-thread [ call ] [ -1 io-multiplex stop ] ifte* ;
|
||||||
|
|
Loading…
Reference in New Issue