Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>LE: Regarding the crash problem see these open bugs: <a href="https://bugzilla.novell.com/show_bug.cgi?id=566324" rel="nofollow noreferrer">Bug 566324</a> , <a href="https://bugzilla.novell.com/show_bug.cgi?id=580791" rel="nofollow noreferrer">Bug 580791</a> , <a href="https://bugzilla.novell.com/show_bug.cgi?id=602502" rel="nofollow noreferrer">Bug 602502</a></p> <p>I'm fairly new to this myself, I present here the information I gathered so far. Maybe it will be useful.</p> <p>1) The Mono.Tasklets library (described by Miguel de Icaza [READ: <a href="http://tirania.org/blog/archive/2009/Apr-09.html" rel="nofollow noreferrer">here</a>]) is a continuation library that can be used to construct various forms of continuation systems and light weight(LW) threads.</p> <p>A simple way of picturing this is the Mono-version of C's longjmp/setjmp, they can only be used to unwind the stack.</p> <p>The library was initially developed by a guy [READ: <a href="http://www.taika.org/~tomba/monoco/index.html" rel="nofollow noreferrer">here</a>] and now it's included in Mono and documented [READ: <a href="http://www.mono-project.com/Continuations" rel="nofollow noreferrer">here</a>] (follow those links and you'll find more information)</p> <p>That guy implemented a Microthreading library on top of this abstraction. and now that has been ported to Mono.Tasklets framework</p> <p>2) A continuation is an object that can be used to store the current execution state and it can then be used to restore the stored state later. </p> <p>"Execution state" here means the stack, which includes call stack and local variables, and the processor's registers. </p> <p>When the stored state is restored the program execution looks like it jumps back to the position where the state was saved, with all the local variables restored.</p> <p><a href="http://homepage.mac.com/sigfpe/Computing/continuations.html" rel="nofollow noreferrer">An example in C.</a> and more info on <a href="http://en.wikipedia.org/wiki/Continuation" rel="nofollow noreferrer">Wikipedia/Continuations</a></p> <p>3) The API is :</p> <pre><code>public class Continuation { public Continuation (); public void Mark (); public int Store (int state); public void Restore (int state); } </code></pre> <p>Continuations can be used to implement <strong>microthreads</strong>. You can look at the code from Mono.MicroThreads available at Github [READ: <a href="http://github.com/mono/mono-microthreads/tree/master/Mono.MicroThreads/" rel="nofollow noreferrer">here</a>]</p> <pre><code> public Continuation() { m_handle = alloc_continuation(); Print("Continuation()"); } public void Mark() { Print("Mark()"); // skip 1 frame, ie. this function mark_continuation_frame(m_handle, 1); } public int Store(int data) { Print("Store({0})", data); int res = store_continuation(m_handle, data); Print("Store({0}) = {1}", data, res); return res; } public void Restore(int data) { Print("Restore({0})", data); restore_continuation(m_handle, data); Print("Restore() exit (NEVER REACHED)"); } </code></pre> <p>From what is presented <a href="http://www.taika.org/~tomba/monoco/index.html" rel="nofollow noreferrer">here</a>:</p> <p><strong><em>Mark()</em></strong> it is used to mark the topmost frame to be stored </p> <p><strong><em>Store(x)</em></strong> stores the current state to the continuation, and returns the given integer x.</p> <p><strong><em>Restore(y)</em></strong> restores the stored state, and returns the given integer y. (Note that the integer y given to Restore is actually returned from the Store() method, because that's where we are after the state has been restored.)</p> <pre><code>static void Main() { Continuation c = new Continuation(); c.Mark(); int foo = 123; int val = c.Store(0); Console.WriteLine("{0} {1}", val, foo); foo = 321; if (val &lt; 5) c.Restore(val + 1); } </code></pre> <p>When you call Store() the current state of execution is recorded and it is possible to go back to this state by invoking Restore(). </p> <p>The caller to Store() tells whether it is the initial store or a restore point based on the result from Store:</p> <pre><code> var c = new Continuation (); ... switch (c.Store (0)){ case 0: // First invocation case 1: // Restored from the point ahead. } ... // Jump back to the switch statement. c.Restore (1); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload