<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Matthew Flatt schreef:
<blockquote cite="mid200505232015.j4NKFj3n049278@slow.flux.utah.edu"
 type="cite">
  <pre wrap="">At Mon, 23 May 2005 22:02:16 +0200, Hans Oesterholt-Dijkema wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap=""> From the "Inside" manual: on scheme_block_until()

"If |f| ever returns a true value, it must continue to return a true 
value. "

Until when? Until scheme_block_until() returns?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Yes. (I've adjusted the manual.)

Matthew

  </pre>
</blockquote>
Thank you. I'm going to implement following:<br>
<br>
1. I'll create a C shared variable V=0.<br>
2. I'll start another C-thread, calling PQExec.<br>
3. I'll call scheme_block_until(), with f() returning V.<br>
4. When PQExec returns, the C-thread will set V=1 <br>
5. I'll join the C thread.<br>
<br>
This will probably do the job, although some overhead<br>
will be involved when running PQExec through a thread.<br>
Another solution might be:<br>
<br>
Given a C-semaphore: S1=0<br>
1. I'll create a C shared variable V, and Q(eury).<br>
2. I'll create a C-thread that waits on semaphore S1.<br>
3. I'll set Q to the query requested and V=0.<br>
4. I'll post S1, which starts the C-thread, which calls PQExec.<br>
5. Ill call scheme_block_until, with f() returning V.<br>
6. When PQExec returns the C-thread will put the result in R, and then
set V to 1, next it will wait on S1.<br>
7. R is returned.<br>
<br>
Which one would you choose? (note: both solutions will instantiate
threads<br>
per sqli-connect (see google: sqli/sqld).<br>
<br>
Hans<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>