<br><br><div class="gmail_quote">On Tue, Jul 5, 2011 at 10:50 PM, Alain Rastoul <span dir="ltr">&lt;<a href="mailto:alr.dev@free.fr" target="_blank">alr.dev@free.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
(sorry for sending this mail again, my pc was off for a long time and the<br>
message was dated from 2007, people who sort their messages would not see<br>
it)<br>
<br>
I&#39;ve done a small program in Pharo 1.3 with glorp+opendbx that insert 1000<br>
rows in a customer table in a sqlite db.<br>
The 1000 insert takes 140 sec (very slow), but the Pharo profiler says that<br>
it spend 95%<br>
of the time waiting for input.<br>
(in InputEventPollingFetcher&gt;&gt; waitForInput)<br>
I was wondering if the queries are executed in another thread than the vm<br>
thread ?<br></blockquote><div><br>Hi Alain. No. Squeak/Pharo&#39;s thread architecture is the so called green thread, that is, only ONE OS thread is used. Internally, the language reifies Process, Scheduler, #fork: , etc etc etc. But from the OS point of view there is only one thread for the VM. So.....the regular FFI blocks the VM. What does it mean? that while the C function called by FFI is being executed, the WHOLE VM is block. Notihgn can happen at the same time. Imagine the function that retrieves the results and needs to wait for them.....TERRIBLE. So...if the backend does not support async quieries, then you are screw and dbx may be slow in Pharo. Nothing to do. <br>

<br>However, some backends support async queries, and opendbx let us configure this. This is explained in: <br><a href="http://www.squeakdbx.org/Architecture%20and%20desing?_s=FlIhkPQOOFSlqf8C&amp;_k=j-3_7Kw_&amp;_n&amp;18" target="_blank">http://www.squeakdbx.org/Architecture%20and%20desing?_s=FlIhkPQOOFSlqf8C&amp;_k=j-3_7Kw_&amp;_n&amp;18</a><br>

where it says &quot;External call implementation&quot;<br><br>You can see the list of backends that support async queries in here: <br><a href="http://www.squeakdbx.org/documentation/Asynchronous%20queries?_s=FlIhkPQOOFSlqf8C&amp;_k=j-3_7Kw_&amp;_n&amp;17" target="_blank">http://www.squeakdbx.org/documentation/Asynchronous%20queries?_s=FlIhkPQOOFSlqf8C&amp;_k=j-3_7Kw_&amp;_n&amp;17</a><br>

<br>Notice that there is some room for improvements, but we didn&#39;t have time so far. Hernik told us some good ideas. But since we didn&#39;t need more power so far we couldn&#39;t find time to integrate his ideas. I am forwarding now the emails to the mailing list. If you can take a look and provide code, it would be awesome. Basically, it improves how and how much we wait in each side: image and opendbx.<br>
<br>Finally, notice that Eliot is working in a multithreared FFI for Cog, but it is not yet available as far as I know. <br><br>Cheers<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">


(I thought I&#39;ve seen a document about opendbx architecture but could&#39;nt find<br>
it on the site).<br>
<br>
TIA<br>
Alain<br>
<br>
<br>
<br>
------------------------------------------------------------------------------<br>
All of the data generated in your IT infrastructure is seriously valuable.<br>
Why? It contains a definitive record of application performance, security<br>
threats, fraudulent activity, and more. Splunk takes this data and makes<br>
sense of it. IT sense. And common sense.<br>
<a href="http://p.sf.net/sfu/splunk-d2d-c2" target="_blank">http://p.sf.net/sfu/splunk-d2d-c2</a><br>
_______________________________________________<br>
libopendbx-devel mailing list<br>
<a href="mailto:libopendbx-devel@lists.sourceforge.net" target="_blank">libopendbx-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/libopendbx-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/libopendbx-devel</a><br>
<a href="http://www.linuxnetworks.de/doc/index.php/OpenDBX" target="_blank">http://www.linuxnetworks.de/doc/index.php/OpenDBX</a><br>
</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>