[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: Review Request: Add spinlocks lock type, based on GCC intrisincs
From:       "Michael Pyne" <mpyne () kde ! org>
Date:       2012-09-03 22:06:12
Message-ID: 20120903220612.19997.9552 () vidsolbach ! de
[Download RAW message or body]

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106224/#review18472
-----------------------------------------------------------


OK, I've committed a spinlock implementation that should work on OpenBSD without \
relying on GCC intrinsics alone (it does rely on Qt's atomic classes though).

Instead of making the additional functions used wait for the CMake changes I've \
simply checked for _POSIX_PRIORITY_SCHEDULING as documented in the Linux manpage (and \
verified not to be defined in OpenBSD's unistd.h or cdefs.h, since sched_yield isn't \
provided in sched.h).

Since the standards regarding sched_yield in particular seem to have changed several \
times recently (most recently moving to the Base specification for SUS) the only safe \
thing would be to have a CMake check for that specific function even if the POSIX \
feature checks appear to support it being available. But that will need to be worked \
on in the 4.10 branch.

- Michael Pyne


On Aug. 26, 2012, 7:09 p.m., Vadim Zhukov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106224/
> -----------------------------------------------------------
> 
> (Updated Aug. 26, 2012, 7:09 p.m.)
> 
> 
> Review request for kdelibs and Michael Pyne.
> 
> 
> Description
> -------
> 
> Add simple spin locking mechanism.
> Written by Michael Pyne as from https://bugs.kde.org/attachment.cgi?id=73282 , with \
> some tweaking by me. 
> 
> This addresses bug 305023.
> http://bugs.kde.org/show_bug.cgi?id=305023
> 
> 
> Diffs
> -----
> 
> kdecore/util/ConfigureChecks.cmake fe9f47e 
> kdecore/util/config-util.h.cmake 83ccdf7 
> kdecore/util/kshareddatacache_p.h ec5a7a0 
> 
> Diff: http://git.reviewboard.kde.org/r/106224/diff/
> 
> 
> Testing
> -------
> 
> On OpenBSD-CURRENT, i386
> 
> 
> Thanks,
> 
> Vadim Zhukov
> 
> 


[Attachment #3 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/106224/">http://git.reviewboard.kde.org/r/106224/</a>
  </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">OK, I&#39;ve committed a \
spinlock implementation that should work on OpenBSD without relying on GCC intrinsics \
alone (it does rely on Qt&#39;s atomic classes though).

Instead of making the additional functions used wait for the CMake changes I&#39;ve \
simply checked for _POSIX_PRIORITY_SCHEDULING as documented in the Linux manpage (and \
verified not to be defined in OpenBSD&#39;s unistd.h or cdefs.h, since sched_yield \
isn&#39;t provided in sched.h).

Since the standards regarding sched_yield in particular seem to have changed several \
times recently (most recently moving to the Base specification for SUS) the only safe \
thing would be to have a CMake check for that specific function even if the POSIX \
feature checks appear to support it being available. But that will need to be worked \
on in the 4.10 branch.</pre>  <br />







<p>- Michael</p>


<br />
<p>On August 26th, 2012, 7:09 p.m., Vadim Zhukov wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kdelibs and Michael Pyne.</div>
<div>By Vadim Zhukov.</div>


<p style="color: grey;"><i>Updated Aug. 26, 2012, 7:09 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Add simple spin locking mechanism. Written by Michael Pyne as from \
https://bugs.kde.org/attachment.cgi?id=73282 , with some tweaking by me.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">On OpenBSD-CURRENT, i386</pre>  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=305023">305023</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kdecore/util/ConfigureChecks.cmake <span style="color: \
grey">(fe9f47e)</span></li>

 <li>kdecore/util/config-util.h.cmake <span style="color: grey">(83ccdf7)</span></li>

 <li>kdecore/util/kshareddatacache_p.h <span style="color: \
grey">(ec5a7a0)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/106224/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic