Skip to content

Files

Latest commit

7c5ee36 · Aug 12, 2014

History

History

scheduler

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
May 30, 2013
Jun 17, 2013
Jul 17, 2013
Jun 20, 2013
Aug 12, 2014
Mar 15, 2013
May 30, 2013
Dec 18, 2011
Mar 15, 2013
Mar 15, 2013
Mar 15, 2013
Dec 18, 2011
Dec 18, 2011
Mar 15, 2013
Dec 18, 2011
Mar 25, 2013
Mar 15, 2013
Jun 2, 2013
Mar 15, 2013
Dec 18, 2011
May 30, 2013
Jun 15, 2013
Dec 18, 2011
Dec 18, 2011
May 10, 2013
Jun 15, 2013
May 29, 2013
Mar 15, 2013
Jun 15, 2013
Dec 30, 2011
Jun 10, 2013
Mar 15, 2013
Dec 18, 2011
Dec 18, 2011
Apr 27, 2013
Jun 10, 2013
Dec 18, 2011
Dec 21, 2011
Jun 15, 2013
May 30, 2013
Dec 18, 2011
May 30, 2013
Mar 15, 2013
Mar 27, 2013
Mar 15, 2013
Mar 15, 2013
Apr 1, 2013
Dec 18, 2011
Apr 21, 2013
Mar 15, 2013
Mar 15, 2013
Mar 27, 2013
May 30, 2013
May 29, 2013
Dec 18, 2011
COMPILATION
===========
For the moment:
% make example

Specfying compile flags:
% OPT="-O0" make example

Supported useful macros (see swan_config.h):
* MODE
% OPT="-O0 -DMODE=0" make example
Verbose debugging mode, no optimization by compiler
% OPT="-O4 -DMODE=1" make example
Very fast mode with *all* debugging turned off and aggressive compiler optimizations

* SUPPORT_GDB
% OPT="-O0 -DSUPPORT_GDB=1" make example
to replicate parts of stack_frames such that gdb finds its way easier.

# * SYNC_THROW -- this has been removed by renaming sync() to ssync().
# Some versions of g++ complain about sync() having different throw() signatures in different places.
# This error messages is sidestepped by:
# % OPT="-O0 -DSYNC_THROW" make example

* DBG_CONTINUATION
% OPT="-O0 -DDBG_CONTINUATION=1" make example
Set to 1 to do additional checking of the continuation. Copies stack stub
to control space and checks on return that it has not been mutated.

* DBG_VERIFY
% OPT="-O0 -DDBG_VERIFY=1" make example
Set to 1 to do additional checking of the sanity of the stack_frame,
in particular the saved BP and SP and the stack_ptr.

* DBG_WF
If set, then sets DBG_CONTINUATION and DBG_VERIFY if they are not already set.

* PENDING_FULL_FRAME
If set, then pending frames are immediately allocated as large (8KB) frames with
the code set up ready for a resume action. If not set, the frame is first allocated
as a more compact pending_frame and is converted to a large frame when it's
execution starts.
It is not (yet) clear what is the best strategy.

For best performance, use
% OPT="-O4 -DSUPPORT_GDB=0 -DDBG_CONTINUATION=0 -DBG_VERIFY=0 -DDBG_WF=0 -DNDEBUG" make example

PROGRAMMING INTERFACE
=====================
By examples.

* Spawn/sync
  chandle<int> k;
  spawn( fib, k, n-1 );
  ...;
  ssync();
  ... = (int)k;

* Call
  int k = call( fib, n - 1 );

* Leaf-call
  leaf_call( printf, "if you need more than %d KB stack space", 4 );