<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
I just pushed a patch from Jay Katta that implements locking in one<br>
of the network models of Ginger:<br>
<br>
"Implement locking for network functions"<br>
<br>
The patch uses threading.RLock(). I guess it's worth a look.<br>
<br>
<br>
Regards<br>
<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 02/23/2016 10:17 AM, Aline Manera
wrote:<br>
</div>
<blockquote cite="mid:56CC5BDF.2060703@linux.vnet.ibm.com"
type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
Hi,<br>
<br>
Kimchi uses a lock to do operations in the virtual machines.<br>
But I think you want a generic solution for any Resource or
Collection, if so, there is no built in support for it yet.<br>
<br>
I don't see any reason to have a lock on a Collection as only GET
and POST methods are allowed in it.<br>
And the POST action is only to create a new Resource in the given
Collection.<br>
<br>
About your solution, I don't think we need a file. We can use
threading.Lock() to do that.<br>
<br>
Regards,<br>
Aline Manera<br>
<br>
<div class="moz-cite-prefix">On 02/19/2016 09:17 AM, Harshal Patil
wrote:<br>
</div>
<blockquote
cite="mid:201602191118.u1JBIJTJ62849036@d28relay03.in.ibm.com"
type="cite">
<div class="socmaildefaultfont" dir="ltr"
style="font-family:Arial;font-size:10.5pt">
<div dir="ltr">Hi,</div>
<div dir="ltr"> </div>
<div dir="ltr">I need to be able to lock certain operations on
a Resource or Resource Collection to make their access
serialized. </div>
<div dir="ltr"> </div>
<div dir="ltr">Is there already any in-built support for it?</div>
<div dir="ltr"> </div>
<div dir="ltr">If not, I was thinking of creating a lock file
in /var/lock/wok and to block access by other users to that
resource unless the lock is cleared. This lock(s) also needs
to be cleared by wok startup script just in case the wok
crashed or stopped forcefully before the lock is cleared by
the owner process. </div>
<div dir="ltr"> </div>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
</blockquote>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kimchi-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kimchi-devel@ovirt.org">Kimchi-devel@ovirt.org</a>
<a class="moz-txt-link-freetext" href="http://lists.ovirt.org/mailman/listinfo/kimchi-devel">http://lists.ovirt.org/mailman/listinfo/kimchi-devel</a>
</pre>
</blockquote>
<br>
</body>
</html>