<br><br><div class="gmail_quote">On Sun, May 29, 2011 at 4:06 AM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sat, 28 May 2011, Mariano Martinez Peck wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What are the errors that I must avoid making ?<br>
</blockquote>
<br>
AFAIK SqueakDBX uses FFI which to my understanding means that it calls<br>
block the entire VM. That reduces the amount of concurrency a single<br>
image can handle. It also makes a connection pool more important.<br>
<br>
<br>
</blockquote>
Yes, FFI blocks the whole VM while a functions is being called. However, if<br>
and only if the database client library supports asynchronous queries,<br>
SqueakDBX will work asynchronously. Basically, we do a loop where we ask the<br>
backend if the query was ready. If it was not, we do a yield (we let other<br>
process of the image to run) and then continue the loop.<br>
</blockquote>
<br></div>
FYI: The expression &quot;Processor yield&quot; doesn&#39;t let all processes run, just those which have the same priority. So using it in a loop starves all lower priority processes and results in busy waiting.<br><font color="#888888">
<br></font></blockquote><div><br>Thanks.  I was not clear. What we actually do is:<br><br>    (code = OpenDBX resultTimeout) ifTrue: [ (Delay forMilliseconds: (aQuerySettings timeout asMiliseconds)) wait  ].<br><br>Is that better?  Even if it lets just run processes of the same priority, this is good anyway because what we want is at least be able to process other queries. Probably, those other processes are being done from other Process.<br>
<br>Thanks<br><br>Mariano<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><font color="#888888">
<br>
Levente</font><div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<a href="http://www.squeakdbx.org/documentation/Asynchronous%20queries" target="_blank">http://www.squeakdbx.org/documentation/Asynchronous%20queries</a><br>
<br>
Eliot implemented a multi-threaded FFI for Cog but so far I am not sure if<br>
it is already working.<br>
<br>
Cheers<br>
<br>
-- <br>
Mariano<br>
<a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br>
<br>
</blockquote></div><div><div></div><div class="h5">
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mariano<br><a href="http://marianopeck.wordpress.com" target="_blank">http://marianopeck.wordpress.com</a><br><br>