lattner wrote:
Nice work Mehdi!
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/joker-eph closed
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From 5f47d05b0310ffe5b20b972c507bce09399aec77 Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From 375add7f2ea7c8aa805c022936e7b65fdefe80b6 Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From 6864303679435f51ce899e348e49bfd11eb4146f Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From d39dfe51ee866a9f45337b015e09d307b0ea994e Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From 41404ed9b7038d712d18b0e16896fae66a954f87 Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From 5851f2980e699f7265bf556ea1889a63f080dc4d Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From eb630caf1bb9689f23c1f7dfe62a80f4c276da0d Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/82094
>From eb630caf1bb9689f23c1f7dfe62a80f4c276da0d Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
@@ -92,30 +104,32 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
@@ -140,54 +142,74 @@ class ThreadPool {
},
std::move(F)};
}
+};
+
+/// A ThreadPool implementation using std::threads.
+///
+/// The pool keeps a vector of threads alive, waiting on a condition variable
+/// for some work to become available.
+class
https://github.com/aganea approved this pull request.
Look good, thank you again for making all these changes!
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From 75c17b79beeb117dbfc407051bb9a7660b69ee62 Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
@@ -209,25 +231,66 @@ class ThreadPool {
/// Number of threads active for tasks in the given group (only non-zero).
DenseMap ActiveGroups;
-#if LLVM_ENABLE_THREADS // avoids warning for unused variable
/// Signal for the destruction of the pool, asking thread to exit.
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From fa249b44a8bbcbc7b0da148c51acd5792f393869 Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From e2a6d2860c21489445a87bfd4ced85108462f601 Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -209,25 +231,66 @@ class ThreadPool {
/// Number of threads active for tasks in the given group (only non-zero).
DenseMap ActiveGroups;
-#if LLVM_ENABLE_THREADS // avoids warning for unused variable
/// Signal for the destruction of the pool, asking thread to exit.
@@ -209,25 +231,66 @@ class ThreadPool {
/// Number of threads active for tasks in the given group (only non-zero).
DenseMap ActiveGroups;
-#if LLVM_ENABLE_THREADS // avoids warning for unused variable
/// Signal for the destruction of the pool, asking thread to exit.
@@ -209,25 +231,66 @@ class ThreadPool {
/// Number of threads active for tasks in the given group (only non-zero).
DenseMap ActiveGroups;
-#if LLVM_ENABLE_THREADS // avoids warning for unused variable
/// Signal for the destruction of the pool, asking thread to exit.
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
GeorgeARM wrote:
Thanks for explaining @joker-eph. Looks good to me.
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
https://github.com/GeorgeARM approved this pull request.
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/aganea approved this pull request.
LGTM with two minor comments.
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -140,54 +142,74 @@ class ThreadPool {
},
std::move(F)};
}
+};
+
+/// A ThreadPool implementation using std::threads.
+///
+/// The pool keeps a vector of threads alive, waiting on a condition variable
+/// for some work to become available.
+class
@@ -209,25 +231,66 @@ class ThreadPool {
/// Number of threads active for tasks in the given group (only non-zero).
DenseMap ActiveGroups;
-#if LLVM_ENABLE_THREADS // avoids warning for unused variable
/// Signal for the destruction of the pool, asking thread to exit.
https://github.com/aganea edited https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
joker-eph wrote:
> Uniqueness is "guaranteed" through memory addressing. Someone can break
> uniqueness when going through the public ThreadPool API.
How so?
> Type safety; sure you don't
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
GeorgeARM wrote:
So the way I see this is:
I have a public API that looks like:
```
virtual void asyncEnqueue(std::function Task, ThreadPoolTaskGroup
*Group) = 0;
// or similar
```
My
https://github.com/joker-eph edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
joker-eph wrote:
> What you get is probably a cleaner API IMHO
I don't quite get why it would cleaner actually? This makes is for a weaker
interface that does not guarantee any uniqueness
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
GeorgeARM wrote:
Sure you can convert the address of the object to a string or int that is fine;
it is not the best but not worse than what is there. You can do this inside the
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
joker-eph wrote:
> We could change for example this with a std::string or uint64_t with probably
> minimal changes to any call site.
How would you get a unique id at runtime if not for the
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
GeorgeARM wrote:
Btw, I still think that passing a `ThreadPoolTaskGroup` for the sole purpose of
a uid is a bit brittle as you bind the interface with this construct but
internally to the
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
aganea wrote:
That point was raised by the OP in the Discourse thread (allow for custom
implementations of `ThreadPoolTaskGroup`) and I think it deserved a clear
answer, and I do agree now to
@@ -92,30 +104,32 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From f13befdfdb8715c034eed6dd4c04f712d30d043a Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
@@ -92,30 +104,32 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
@@ -92,30 +104,20 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
@@ -92,30 +104,32 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
https://github.com/joker-eph edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
joker-eph wrote:
> Wouldn't the implemention for ThreadPoolTaskGroup come in hand with the one
> for ThreadPool?
Right now the only thing the TaskGroup provide is a unique ID in the form of
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
GeorgeARM wrote:
Get the point of @aganea; the `ThreadPoolTaskGroup` is a bit tricky to reason
when it comes to customized extensibility as the concrete implementation is
injected to the
@@ -92,30 +104,20 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
https://github.com/GeorgeARM commented:
Sorry to pitch in; hope my comments help.
Overall, looks like a nice starting drop-in interface injection on top of the
what we have. Thanks @joker-eph
https://github.com/llvm/llvm-project/pull/82094
___
https://github.com/GeorgeARM edited
https://github.com/llvm/llvm-project/pull/82094
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
@@ -227,7 +265,7 @@ class ThreadPool {
class ThreadPoolTaskGroup {
aganea wrote:
Wouldn't the implemention for `ThreadPoolTaskGroup` come in hand with the one
for `ThreadPool`? I feel if someone implements the `ThreadPoolInterface` they
would want something
@@ -92,30 +104,32 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
@@ -92,30 +104,32 @@ class ThreadPool {
);
}
- /// Blocking wait for all the threads to complete and the queue to be empty.
- /// It is an error to try to add new tasks while blocking on this call.
- /// Calling wait() from a task would deadlock
https://github.com/joker-eph updated
https://github.com/llvm/llvm-project/pull/82094
>From f9f2e9380b1333b3b2503aebb6ee234b84b8c035 Mon Sep 17 00:00:00 2001
From: Mehdi Amini
Date: Fri, 16 Feb 2024 21:55:57 -0800
Subject: [PATCH] Split the llvm::ThreadPool into an abstract base class and an
60 matches
Mail list logo