chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Multiple concurrent top levels?


From: John Cowan
Subject: Re: [Chicken-users] Multiple concurrent top levels?
Date: Fri, 2 Aug 2013 12:56:58 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

Dan Leslie scripsit:

> Yes, multiple, simultaneous and independent Scheme instances.

Unless you either (a) are deeply committed to Chicken or (b) need the
fastest possible performance on a single core, then you might want to
consider shifting to Chibi Scheme for this application.  The dialects
are reasonably close, and it's not at all hard to port Chicken code
to Chibi or vice versa (I routinely develop libraries to run on both).
There aren't nearly as many prepackaged libraries for Chibi, but since we
have source, it's not hard to port them either if they don't involve FFI.

Chibi is a byte-compiled Scheme designed to run embedded in C and in very
little space.  Its C API allows you to create any number of distinct
execution contexts either in separate heaps (as you want here) or with
shared heaps.  Execution contexts for separate heaps require no locking,
so they can be run in distinct OS threads, which may in turn be running
on separate cores.  (Chicken cannot currently do this.)

In order to share an object between heaps, the C code must take
responsibility for telling Chibi not to destroy the object when it is no
longer referenced in its home heap, and then eventually to destroy it.
Finalizers are available to assist in this.  Alternatively, you can
share pure C objects and use the Chibi FFI to provide Scheme with access
to them.

-- 
Barry thirteen gules and argent on a canton azure           John Cowan
fifty mullets of five points of the second,             address@hidden
six, five, six, five, six, five, six, five, and six.
        --blazoning the U.S. flag           http://www.ccil.org/~cowan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]