<div dir="ltr">On Fri, May 31, 2013 at 2:10 PM, Michael Hendricks <span dir="ltr">&lt;<a href="mailto:michael@ndrix.org" target="_blank">michael@ndrix.org</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="im">On Fri, May 31, 2013 at 5:56 AM, Rune Kjær Svendsen <span dir="ltr">&lt;<a href="mailto:runesvend@gmail.com" target="_blank">runesvend@gmail.com</a>&gt;</span> wrote:<br>

</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>I have an application that wants to keep up with new blocks as they come in. For that I can use the -blocknotify option with bitcoind, which will execute my application for each new block.</div>


<div><br>

</div><div>The problem is that my app isn&#39;t necessarily quick enough to finish its work before a new block comes in and the app is executed again.</div></div></blockquote><div><br></div></div><div>In a similar circumstance, I changed my -blocknotify script to quickly append necessary information to a queue and immediately exit.  A separate script runs at all times monitoring this queue for work and performs the labor intensive calculations.</div>

</div></div></div></blockquote><div><br></div><div>I&#39;ve thought about this as well. It just seems somewhat clunky to me. I&#39;d really prefer having bitcoind put out messages in batches, if it&#39;s doable, that is.</div>

<div><br></div><div>I&#39;d run into a lot of concurrency issues, as far as I can see, where I can&#39;t be sure that the queue isn&#39;t written to while, for example, it is opened by the program that needs to process the queue items.</div>

<div><br></div><div>What if a disk operation takes a long time to finish, and a two queue operations want to add to the queue simultaneously? This really brings forward all the horrors of concurrent programming.</div><div>

<br></div><div><br><div class="gmail_quote">On Fri, May 31, 2013 at 2:17 PM, Jeremy Spilman <span dir="ltr">&lt;<a href="mailto:jeremy@taplink.co" target="_blank">jeremy@taplink.co</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Would it work to just block the bitcoind thread until your process exits?<br><div></div></blockquote></div></div></div><br></div><div class="gmail_extra">I don&#39;t think that&#39;s optimal, no. That would slow down synchronization drastically.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">It would be really nimble for bitcoind to be able to synchronize at full speed, and only send out events when necessary, batching together previously queued items.</div>

</div>