aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/LuaJIT-1.1.7/jitdoc/coco.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/LuaJIT-1.1.7/jitdoc/coco.html132
1 files changed, 132 insertions, 0 deletions
diff --git a/libraries/LuaJIT-1.1.7/jitdoc/coco.html b/libraries/LuaJIT-1.1.7/jitdoc/coco.html
new file mode 100644
index 0000000..0ef43f1
--- /dev/null
+++ b/libraries/LuaJIT-1.1.7/jitdoc/coco.html
@@ -0,0 +1,132 @@
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3<head>
4<title>Coco</title>
5<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6<meta name="Author" content="Mike Pall">
7<meta name="Copyright" content="Copyright (C) 2005-2011, Mike Pall">
8<meta name="Language" content="en">
9<link rel="stylesheet" type="text/css" href="bluequad.css" media="screen">
10<link rel="stylesheet" type="text/css" href="bluequad-print.css" media="print">
11</head>
12<body>
13<div id="site">
14<a href="http://luajit.org/"><span>Lua<span id="logo">JIT</span></span></a>
15</div>
16<div id="head">
17<h1>Coco</h1>
18</div>
19<div id="nav">
20<ul><li>
21<a href="index.html">Index</a>
22</li><li>
23<a href="luajit.html">LuaJIT</a>
24<ul><li>
25<a href="luajit_features.html">Features</a>
26</li><li>
27<a href="luajit_install.html">Installation</a>
28</li><li>
29<a href="luajit_run.html">Running</a>
30</li><li>
31<a href="luajit_api.html">API Extensions</a>
32</li><li>
33<a href="luajit_intro.html">Introduction</a>
34</li><li>
35<a href="luajit_performance.html">Performance</a>
36</li><li>
37<a href="luajit_debug.html">Debugging</a>
38</li><li>
39<a href="luajit_changes.html">Changes</a>
40</li></ul>
41</li><li>
42<a class="current" href="coco.html">Coco</a>
43<ul><li>
44<a href="coco_portability.html">Portability</a>
45</li><li>
46<a href="coco_api.html">API Extensions</a>
47</li><li>
48<a href="coco_changes.html">Changes</a>
49</li></ul>
50</li><li>
51<a href="dynasm.html">DynASM</a>
52<ul><li>
53<a href="dynasm_features.html">Features</a>
54</li><li>
55<a href="dynasm_examples.html">Examples</a>
56</li></ul>
57</li><li>
58<a href="http://luajit.org/download.html">Download <span class="ext">&raquo;</span></a>
59</li></ul>
60</div>
61<div id="main">
62<p>
63Coco is a small extension to get <strong>True C&nbsp;Coroutine</strong>
64semantics for Lua 5.1.
65</p>
66<p>
67Coco is both available as a stand-alone release and integrated
68into <a href="luajit.html">LuaJIT</a> 1.x.
69</p>
70<p>
71The stand-alone release is a patchset against the
72<a href="http://www.lua.org/ftp/"><span class="ext">&raquo;</span>&nbsp;standard Lua 5.1.4</a>
73distribution. There are no dependencies on LuaJIT. However LuaJIT 1.x
74depends on Coco to allow yielding for JIT compiled functions.
75</p>
76<p>
77Coco is Copyright &copy; 2004-2011 Mike Pall.
78Coco is free software, released under the
79<a href="http://www.opensource.org/licenses/mit-license.php"><span class="ext">&raquo;</span>&nbsp;MIT/X license</a>
80(same license as the Lua core).
81</p>
82<h2>Features</h2>
83<p>
84True C&nbsp;coroutine semantics mean you can yield from a coroutine
85across a C&nbsp;call boundary and resume back to it.
86</p>
87<p>
88Coco allows you to use a dedicated C&nbsp;stack for each coroutine.
89Resuming a coroutine and yielding from a coroutine automatically switches
90C&nbsp;stacks, too.
91</p>
92<p>
93In particular you can now:
94</p>
95<ul>
96<li>Yield across all metamethods (not advised for <tt>__gc</tt>).</li>
97<li>Yield across iterator functions (<tt>for x in func do</tt>).</li>
98<li>Yield across callbacks (<tt>table.foreach()</tt>, <tt>dofile()</tt>, ...).</li>
99<li>Yield across protected callbacks (<tt>pcall()</tt>, <tt>xpcall()</tt>, ...).</li>
100<li>Yield from C&nbsp;functions and resume back to them.</li>
101</ul>
102<p>
103Best of all, you don't need to change your Lua or C&nbsp;sources
104and still get the benefits. It's fully integrated into the
105Lua core, but tries to minimize the required changes.
106</p>
107
108<h2>More ...</h2>
109<p>
110Please visit the <a href="http://luajit.org/download.html"><span class="ext">&raquo;</span>&nbsp;Download</a> page
111to fetch the current version of the stand-alone package.
112</p>
113<p>
114Coco needs some machine-specific features &mdash; please have a look
115at the <a href="coco_portability.html">Portability Requirements</a>.
116</p>
117<p>
118Coco also provides some upwards-compatible
119<a href="coco_api.html">API Extensions</a> for Lua.
120</p>
121<br class="flush">
122</div>
123<div id="foot">
124<hr class="hide">
125Copyright &copy; 2005-2011 Mike Pall
126<span class="noprint">
127&middot;
128<a href="contact.html">Contact</a>
129</span>
130</div>
131</body>
132</html>