Repository navigation
Conversation
|
What possible use of this is there? <h3 id="spurious-wakeups">Spurious wakeups</h3>
<span line-number="2"></span>
<p>The <code>pthread</code> documentation says</p>
<span line-number="4"></span>
<blockquote>
<span line-number="6"></span>
<p>Spurious wakeups from the <code>pthread_cond_wait()</code> function may occur. Since the return from <code>pthread_cond_wait()</code> does not imply anything about the value of this predicate, the predicate should be re-evaluated upon such return.</p>
</blockquote>
<span line-number="6"></span>
<p>When a "spurious wakeup" happens, a thread that is currently blocked on <code>pthread_cond_wait()</code> is awaken, even if no other thread has called <code>pthread_cond_signal()</code> on that condition. This means one must re-evaluate the condition every time the <code>pthread_cond_wait()</code> returns and, if needed, call it again.</p>
<span line-number="8"></span>
<p>A good rule of thumb is to always wait upon a condition variable within a loop which checks the condition every time:</p>
<span line-number="10"></span>
<pre><code class="lang-cpp">while (counts[my] < N_THREADS)
pthread_cond_wait(&condition, &mutex);
</code></pre> |
|
I use it my editor/preview control. I think it works smooth. Also added a code snippet: Preview synchonizationMarkdown preview blockFor markdown preview block on scroll event you can use the following code. Ace editor integration |
|
@Feder1co5oave line-number inside a blockquote is a bug. I will fix it. |
|
Fixed blockquote bug. |
|
Hi, I think the line number doesn't work properly for "list". |
|
@shd101wyy Hello! Unfortunately it only works for top level blocks, because it requires more serious refinement otherwise. |
|
Thx! |
|
@andr2 I am having the same issue to solve. Did you stay with that solution? How is the final performance to the end user? ps: I am using percentage of the editor/preview scroll position to synchronise the other panel. |
|
@paulocheque yes. For nested blocks I scroll proportionally (see code sample above). |
|
Closing as stale, do not believe targeted specs support this, merge conflicts, and missing tests (??). |
|
Nice. what is |
Added options.lineNumbers
Renders
Also added lineNumber renderer
WARNING: Degrading in performance in node.js due to Extract Method refactoring. From 3496ms to 4008ms.
Tests passed