lets start it using CUDA <br><br><div class="gmail_quote">On Mon, Dec 10, 2012 at 9:48 PM, Mark Reynolds <span dir="ltr"><<a href="mailto:mareynol@redhat.com" target="_blank">mareynol@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
On 12/10/2012 10:57 AM, Ludwig Krispenz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
And I think be_addsuffix is not safe.<br>
<br>
If two threads try to add a suffix, both can get the same current count, the both set the new suffix<br>
be->be_suffix[count]= slapi_sdn_dup(suffix);<br>
<br>
and then both increment count. the increment is atomic, but the assignment could be done to the wrong index.<br>
</blockquote></div>
Hi Ludwig,<br>
<br>
Nice catch, patch is revised to use the suffix lock when adding a new suffix.<br>
<br>
As for the first issue you mentioned, I do not see this being a problem. We would of requested a be search prior to a new suffix being created. Once the suffix is fully added, then we increment the count. So I don't see any issue with this.<span class="HOEnZb"><font color="#888888"><br>
<br>
Mark</font></span><div class="im HOEnZb"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Ludwig<br>
<br>
On 12/10/2012 04:49 PM, Ludwig Krispenz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Mark,<br>
<br>
in the locked version the list of suffixes cannot be changed while you loop over them. In your version you get the suffix count and the do a for loop i=0..count on it. Although suffixes don't get deleted from the array there couls be cases where one is added from the time you get the count to whwn you execute the loop. Could this be a problem ?<br>
<br>
Ludwig<br>
<br>
<br>
On 12/10/2012 04:29 PM, Mark Reynolds wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here is the lock-free version....<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="https://fedorahosted.org/389/ticket/509" target="_blank">https://fedorahosted.org/389/<u></u>ticket/509</a><br>
<br>
<a href="https://fedorahosted.org/389/attachment/ticket/509/0001-Ticket-509-lock-free-access-to-be-be_suffixlock.patch" target="_blank">https://fedorahosted.org/389/<u></u>attachment/ticket/509/0001-<u></u>Ticket-509-lock-free-access-<u></u>to-be-be_suffixlock.patch</a> <br>
<br>
</blockquote>
<br>
</blockquote>
<br>
-- <br>
389-devel mailing list<br>
<a href="mailto:389-devel@lists.fedoraproject.org" target="_blank">389-devel@lists.fedoraproject.<u></u>org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/389-devel" target="_blank">https://admin.fedoraproject.<u></u>org/mailman/listinfo/389-devel</a><br>
</blockquote>
<br>
-- <br>
389-devel mailing list<br>
<a href="mailto:389-devel@lists.fedoraproject.org" target="_blank">389-devel@lists.fedoraproject.<u></u>org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/389-devel" target="_blank">https://admin.fedoraproject.<u></u>org/mailman/listinfo/389-devel</a><br>
</blockquote>
<br></div><div class="im HOEnZb">
-- <br>
Mark Reynolds<br>
Red Hat, Inc<br>
<a href="mailto:mreynolds@redhat.com" target="_blank">mreynolds@redhat.com</a><br>
<br></div><div class="HOEnZb"><div class="h5">
--<br>
389-devel mailing list<br>
<a href="mailto:389-devel@lists.fedoraproject.org" target="_blank">389-devel@lists.fedoraproject.<u></u>org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/389-devel" target="_blank">https://admin.fedoraproject.<u></u>org/mailman/listinfo/389-devel</a></div></div></blockquote></div><br>