[nhc-users] FFI "wrapper"

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Thu Oct 16 11:08:19 EDT 2008


Donn,

> a thread
> interlock that serializes access from different threads to the
> runtime, The thread that holds the lock runs until an I/O operation,
> then releases the lock,

Provided we are talking about a single sequential processor, then
concurrent thread access to the heap should be largely OK I guess,
because heap values are immutable.  The only thing the RTS needs to be
careful about is if one thread accesses a heap cell and finds it is
blackholed (i.e. currently under evaluation by a different thread), then
it should block until the cell is updated.  I believe Yhc already does
this.

However, if there are multiple processors accessing the same shared
memory containing the heap, then I suppose the RTS would additionally
need to place a lock around an individual cell during the heap-update
operation.  The GC would also need to stop all threads whilst collecting.

Regards,
    Malcolm


More information about the Nhc-users mailing list