User Tools

Site Tools


dana-system-calls

This is an old revision of the document!


Dana provides a number of “system calls” in its runtime. These calls provide a range of low-level functionality.

General utilities

dana.getByteArrayOf(Data x)

This returns a writable array of type byte[]. It only works on Data instances that contain fields of primitive types.

dana.getIDC()

This returns an IDC of the Dana runtime. This IDC can then be queried for further interfaces that the runtime provides (such as io.Output).

dana.htod(int x)

This converts an integer value in the host machine's native format to Dana's format for integer representation (i.e. network big endian).

dana.dtoh(int x)

This converts an integer value in Dana's format for integer representation (i.e. network big endian) to the host machine's native format.

Runtime adaptation

dana.pauseObject(IDC com, Object o)

Typically used as part of runtime adaptation, this prevents further function calls from entering the given object, instead holding those calls at the point of invocation. The supplied component reference must be the one from which object is currently sourced.

dana.resumeObject(Object o)

Typically used as part of runtime adaptation, this re-enables function calls to enter the given object, and also resumes any previous held calls.

dana.getObjectInterface(IDC source, Object o, Type t)

Typically used as part of runtime adaptation, this operation queries the given object for an interface of the given type, returning the same instance of that object but with the type of the requested interface (if present).

dana.rewireObject(Object x, Object y)

Typically used as part of runtime adaptation, this adapts object x such that it uses the implementation (and internal state) of object y. This operation returns a third object which represents object x as known by its previous implementation before it was rewired.

dana.waitForObject(Object x)

Typically used as part of runtime adaptation, this waits for all in-progress function calls in object x to finish.

dana.waitForObjectThreads(Object x)

Typically used as part of runtime adaptation, this waits for asynchronous threads to finish in the object.

dana.halt(IDC ofComponent, Object x)

This operation forces all computation in the given object to stop (including all threads that have stack frames passing through this object), blocking until this is true. Note that this operation is currently experimental as it does not deal with blocking native library calls – if any computation active in, or passing through, Object x is currently in a blocking native library call, this may cause dana.halt to block indefinitely.

dana-system-calls.1563285522.txt.gz · Last modified: 2019/07/16 09:58 by barryfp

Page Tools