[Lldb-commits] Fwd: [PATCH] LLDB Command line driver windows changes.

Aidan Dodds aidan.dodds at googlemail.com
Fri Oct 11 03:19:08 PDT 2013


Ok, after some reading I can see that the solution using volatile is not as
good as I thought it would be.
As for the 10ms delay, I thought that would just be good practice to hand
the CPU back to the OS and other threads instead of wasting cycles in an
empty loop.
I will try to come up with a solution using std::atomic or
std::condition_variable which should be much cleaner.


On 10 October 2013 20:48, Greg Clayton <gclayton at apple.com> wrote:

> I didn't catch the spin lock. We should either use std::atomic or there as
> std::condition_variable if condition variables are needed.
>
>
>
>
> On Oct 10, 2013, at 11:45 AM, Richard Mitton <richard at codersnotes.com>
> wrote:
>
> >
> >  Why does this replace a condition variable with a 10 millisecond
> >  spinlock? Spinlocks are bad.
> >
> >  I don't know about the C++11 standard, but if you want the same effect
> >  on Windows you'd just use SetEvent.
> >
> >  Also don't use volatile. In fact, never use volatile. m_output_flushed
> >  is a class variable, so the compiler knows to reload it each time
> anyway.
> >
> >  Richard Mitton
> >  richard at codersnotes.com
> >
> > http://llvm-reviews.chandlerc.com/D1785
> > _______________________________________________
> > lldb-commits mailing list
> > lldb-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20131011/4ca0ec99/attachment.html>


More information about the lldb-commits mailing list