Hi Michael,<div>a little comment on your URLs.</div><div><br></div><div>the Jenkov link says that we should use the java.util.concurrent package instead of implementing our own.</div><div>I read the probably most well known book about concurrency in Java, written by "the father of concurrency" Brian Goetz:</div>
<div><a href="http://www.javaconcurrencyinpractice.com/">http://www.javaconcurrencyinpractice.com/</a></div><div><br></div><div>The book is very very good, and I remember one sentence which he outlined again and again:</div>
<div>concurrency code written from scratch will always have bug, even mature frameworks will still have bugs, just because the concurrency is such a complex technical topic.</div><div><br></div><div>So, I just want to say: be careful when bringing something like this into Yanel. Maybe start small before designing a huge synchronization facade.</div>
<div><br></div><div>Cheers</div><div>Balz<br><br><div title="signature"> </div><div class="gmail_quote">On Wed, May 30, 2012 at 2:55 PM, basZero <span dir="ltr"><<a href="mailto:baszero@gmail.com" target="_blank">baszero@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Michael,<div>i can have a look at my mails and I'll send them to you again.</div><div><br></div><div>Your suggested behaviour looks good to me, although the waiting write for all active reads is probably not that easy to implement.</div>

<div><br></div><div>Another very important aspect is to consider the correct scope:</div><div>- global files (e.g. a data file that can be modified by any user) must use a LOCK object of global scope (that's easy, it's a public static final Object GLOBAL_LOCK = new Object();)</div>

<div><br></div><div>- user specific files (e.g. user profile extension), files that are modified by the same user, always, such modifications do not need to be synchronized globally, but within the session. For Zwischengas I have implemented a nice helper class which uses an object stored in the user's session which gets used for session-scoped synchronization.</div>

<div><br></div><div>If you are planning to draft a design for this, I will spend some time to review it, if you want. Or we can have another tech-lunch together :)</div><div><br></div><div>Cheers</div><div>Balz</div><div class="HOEnZb">
<div class="h5"><div>
<br><div title="signature"> </div><div class="gmail_quote">On Wed, May 30, 2012 at 2:43 PM, Michael Wechner <span dir="ltr"><<a href="mailto:michael.wechner@wyona.com" target="_blank">michael.wechner@wyona.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Balz<br>
<br>
I remember that you once suggested how we should improve concurrent read/write operations, but<br>
unfortunately I cannot find your email anymore.<br>
<br>
I think the behaviour should be as follows:<br>
<br>
- Concurrent read operations do not block each other<br>
- If a thread wants to write, then it first needs to wait until all current read operations have finished<br>
- A write operation blocks new read requests until the writing has finished<br>
<br>
It seems to me the following articles describe the solution quite nicely<br>
<br>
<a href="http://www.javalobby.org/java/forums/t45090.html" target="_blank">http://www.javalobby.org/java/<u></u>forums/t45090.html</a><br>
<a href="http://tutorials.jenkov.com/java-concurrency/read-write-locks.html" target="_blank">http://tutorials.jenkov.com/<u></u>java-concurrency/read-write-<u></u>locks.html</a><br>
<br>
WDYT?<br>
<br>
As an alternative we could also implement the functionality, that if a repository has revisions enabled and<br>
if revisions are actually being created, that the read process always accesses the most recent revision, which<br>
would normally be the same as accessing the actuall node. Of course the creation of the revision would also have to be locked.<br>
<br>
Thanks<span><font color="#888888"><br>
<br>
Michael<br>
-- <br>
Yanel-development mailing list <a href="mailto:Yanel-development@wyona.com" target="_blank">Yanel-development@wyona.com</a><br>
<a href="http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development" target="_blank">http://lists.wyona.org/cgi-<u></u>bin/mailman/listinfo/yanel-<u></u>development</a><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>