================
Comment at: 
test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py:83
@@ -80,1 +82,3 @@
+        # std::thread may cause the program to spin up a thread pool (and it 
does on
+        # Windows), so the thread numbers are non-deterministic.
 
----------------
chaoren wrote:
> amccarth wrote:
> > chaoren wrote:
> > > I thought these thread numbers are assigned by order of creation. When 
> > > you say non-deterministic, do you mean the new thread notifications (if 
> > > it exists on Windows), come in non-deterministic order? Even if the 
> > > thread creations are separated by a long interval?
> > Microsoft's std::thread implementation seems to spin up a thread pool when 
> > you create your first thread.  On my machine, it immediately creates three 
> > new threads, and which if them is actually tasked to do the work seems to 
> > be non-deterministic.
> Ah, I see what you mean. Would it be possible to identify and hide these 
> auxiliary threads? I can't think of a scenario in which it would be 
> beneficial to see them. Aside from that, the regular threads //do// come in 
> the correct order right? If I understood you correctly, a new thread creation 
> could be 1) actually creating a new thread 2) assigning an existing thread 
> from the thread pool to the task. Would it be possible to detect case 2) and 
> treat it as a new thread creation?
I don't see a way to distinguish a between a thread pool thread that's waiting 
for work v. one that's been assigned to do work.  I'm not even sure how to 
identify if one of them is the thread-pool manager (if there is such a thing).

http://reviews.llvm.org/D10850

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/



_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to