Common Lisp Package: GREEN-THREADS

README:

FUNCTION

Public

ALL-THREADS

Returns a list of all active threads, which are threads that have been created but not destroyed or finished.

CURRENT-THREAD

Returns the currently running greed thread or NIL if not called from within thread.

DESTROY-THREAD (THREAD)

Destroys the thread passed in, so it will not run any more. It is an error to call this on the current thread.

FINISH (FUTURE &REST VALUES)

Mark a future as finished, along with all values it's finished with. If finished with another future, forward the current future to the new one.

FUTURE-VALUES (FUTURE)

Returns the values given to the future when it was completed.

GET-JOIN-FUTURE (THREAD)

Gets a future object from thread which will be completed when the thread is finished.

MAKE-FUTURE (&KEY PRESERVE-CALLBACKS (REATTACH-CALLBACKS T))

Create a blank future.

MAKE-THREAD (FUNCTION &KEY NAME)

Create a new green thread with an optional :name. The first parameter should be a function that takes no arguments. The thread will be queued immediately, so will run immediately if make-thread is called from outside any other green threads. Returns a thread object.

QUEUE-FUTURE (FUTURE ACTION &OPTIONAL THREAD)

Queues an action on current (or specified) thread to take place when provided future is completed.

THREAD-ALIVE-P (THREAD)

Returns T if the passed in thread has not been destroyed.

THREAD-NAME (THREAD)

Returns the name of the thread given at the time of creation or NIL.

THREADP (OBJ)

Returns T if the object passed in is a thread.

Undocumented

JOIN-THREAD (&REST ARGS)

QUEUE-NEXT (ACTION &OPTIONAL THREAD)

RECV/CC (&REST ARGS)

SEND/CC (&REST ARGS)

THREAD-YIELD (&REST ARGS)

WAIT-ON (&REST ARGS)

Private

Undocumented

BINDINGS-FROM-ALIST (ALIST)

CONSTRUCT-BATCHED-QUEUE (FRONT REAR)

QUEUE-NEXT-REPLACE (ACTION &OPTIONAL THREAD)

THREAD-LOOP

MACRO

Public

WITH-GREEN-THREAD (&BODY BODY)

A convenience macro that runs the code in a lambda wrapped in CPS transformin macros and a call to make-thread. Returns thread object.

GENERIC-FUNCTION

Public

Undocumented

RECV (CHANNEL CONTINUATION &KEY (BLOCKP T))

SEND (CHANNEL VALUE CONTINUATION &KEY (BLOCKP T))

Private

Undocumented

EMPTY-P (SEQUENCE)

SIZE (SEQUENCE)

SNOC (SEQUENCE VALUE)

TAIL (SEQUENCE)

SLOT-ACCESSOR

Public

FUTURE-FINISHED-P (OBJECT)

Marks if a future has been finished or not.

Private

Undocumented

ALIVE (OBJECT)

SETFALIVE (NEW-VALUE OBJECT)

BINDING-SYMBOLS (OBJECT)

BINDING-VALUES (OBJECT)

JOIN-FUTURE (OBJECT)

NAME (OBJECT)

NEXT-ACTION (OBJECT)

SETFNEXT-ACTION (NEW-VALUE OBJECT)

VARIABLE

Public

Undocumented

*DEFAULT-SPECIAL-BINDINGS*

Private

Undocumented

*ACTIVE-THREADS*

*CURRENT-THREAD*

*THREAD-QUEUE*

CLASS

Public

Undocumented

CHANNEL

Private

Undocumented

BATCHED-QUEUE

THREAD