diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2013-11-16 10:46:20 +0100 |
---|---|---|
committer | Benoit Germain <bnt.germain@gmail.com> | 2013-11-16 10:46:20 +0100 |
commit | 12a2a85e25578f8a2623c44150fb7e38615bc465 (patch) | |
tree | f45db69ca6a735b78713ee6255f4d6324f3b7641 /docs/index.html | |
parent | 76ac1039c13e20b1e369f8f992de851b31c2e806 (diff) | |
download | lanes-12a2a85e25578f8a2623c44150fb7e38615bc465.tar.gz lanes-12a2a85e25578f8a2623c44150fb7e38615bc465.tar.bz2 lanes-12a2a85e25578f8a2623c44150fb7e38615bc465.zip |
Update documentation
Diffstat (limited to 'docs/index.html')
-rw-r--r-- | docs/index.html | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/docs/index.html b/docs/index.html index 2436ba0..40930d8 100644 --- a/docs/index.html +++ b/docs/index.html | |||
@@ -70,7 +70,7 @@ | |||
70 | </p> | 70 | </p> |
71 | 71 | ||
72 | <p> | 72 | <p> |
73 | This document was revised on 22-Oct-13, and applies to version <tt>3.7.1</tt>. | 73 | This document was revised on 16-Nov-13, and applies to version <tt>3.7.2</tt>. |
74 | </p> | 74 | </p> |
75 | </font> | 75 | </font> |
76 | </center> | 76 | </center> |
@@ -1189,17 +1189,21 @@ events to a common Linda, but... :).</font> | |||
1189 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> | 1189 | <table border="1" bgcolor="#E0E0FF" cellpadding="10" style="width:50%"><tr><td><pre> |
1190 | lock_func = lanes.genlock( linda_h, key [,N_uint=1]) | 1190 | lock_func = lanes.genlock( linda_h, key [,N_uint=1]) |
1191 | 1191 | ||
1192 | lock_func( M_uint ) -- acquire | 1192 | bool = lock_func( M_uint [, "try"] ) -- acquire |
1193 | .. | 1193 | .. |
1194 | lock_func( -M_uint ) -- release | 1194 | bool = lock_func( -M_uint) -- release |
1195 | </pre></td></tr></table> | 1195 | </pre></td></tr></table> |
1196 | 1196 | ||
1197 | <p> | 1197 | <p> |
1198 | The generated function acquires M entries from the N available, or releases them if the value is negative. The acquiring call will suspend the lane, if necessary. Use <tt>M=N=1</tt> for a critical section lock (only one lane allowed to enter). | 1198 | The generated function acquires M tokens from the N available, or releases them if the value is negative. The acquiring call will suspend the lane, if necessary. Use <tt>M=N=1</tt> for a critical section lock (only one lane allowed to enter). |
1199 | <br> | ||
1200 | When passsing <tt>"try"</tt> as second argument when acquiring, then <tt>lock_func</tt> operates on the linda with a timeout of 0 to emulate a TryLock() operation. If locking fails, <tt>lock_func</tt> returns <tt>false</tt>. <tt>"try"</tt> is ignored when releasing (as it it not expected to ever have to wait unless the acquisition/release pairs are not properly matched). | ||
1201 | <br> | ||
1202 | Upon successful lock/unlock, <tt>lock_func</tt> returns <tt>true</tt> (always the case when block-waiting for completion). | ||
1199 | </p> | 1203 | </p> |
1200 | 1204 | ||
1201 | <p> | 1205 | <p> |
1202 | Note: The locks generated are <u>not recursive</u>. That would need another kind of generator, which is currently not implemented. | 1206 | Note: The generated locks are <u>not recursive</u> (A single lane locking several times will consume tokens at each call, and can therefore deadlock itself). That would need another kind of generator, which is currently not implemented. |
1203 | </p> | 1207 | </p> |
1204 | 1208 | ||
1205 | <p> | 1209 | <p> |