[clangd] ClangdScheduler & LLVM ThreadPool

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[clangd] ClangdScheduler & LLVM ThreadPool

Robinson, Paul via cfe-dev
Hi all,

I am wondering about the fact that there is an implementation of asynchronous message queue (ClangdScheduler) in clangd which in principle is similar to what ThreadPool in LLVM Support does. I just wanted to ask what other people think about possibility of using ThreadPool in clangd as we could potentially spare some resources on maintaining only one version. It’s not a lot of code and those two implementations are not exactly the same so some one-time effort would be needed but it still might be worthwhile.




Regards,
Jan

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clangd] ClangdScheduler & LLVM ThreadPool

Robinson, Paul via cfe-dev
Hi Jan,

Implementation used in clangd is a little specific to clangd, e.g. it allows to add requests to both ends of the queue (to allow high-priority ops like completion to be run before everything else).
We'll also be moving away from ThreadPool-like interface for ClangdScheduler to better handle the resources we use and minimize unneeded pauses (e.g., we wait() for ASTs to parse on the worker threads, keeping workers from doing useful work).

I'm currently working on revamped threading implementation in clangd, so I suggest waiting before it lands. (I'll make sure to update this thread when it does).
I'll also keep an eye on whether we would be able to reuse the ThreadPool in the new implementation.

On Wed, Nov 29, 2017 at 11:33 AM, Jan Korous via cfe-dev <[hidden email]> wrote:
Hi all,

I am wondering about the fact that there is an implementation of asynchronous message queue (ClangdScheduler) in clangd which in principle is similar to what ThreadPool in LLVM Support does. I just wanted to ask what other people think about possibility of using ThreadPool in clangd as we could potentially spare some resources on maintaining only one version. It’s not a lot of code and those two implementations are not exactly the same so some one-time effort would be needed but it still might be worthwhile.




Regards,
Jan

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




--
Regards,
Ilya Biryukov

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [clangd] ClangdScheduler & LLVM ThreadPool

Robinson, Paul via cfe-dev
Hi Ilya,

Thank you for your feedback. I am not really rushing to rewrite ClangdScheduler I was mostly just curious about the possibility. 

I am looking forward to your new threading implementation!

Jan

On Nov 29, 2017, at 11:27 AM, Ilya Biryukov <[hidden email]> wrote:

Hi Jan,

Implementation used in clangd is a little specific to clangd, e.g. it allows to add requests to both ends of the queue (to allow high-priority ops like completion to be run before everything else).
We'll also be moving away from ThreadPool-like interface for ClangdScheduler to better handle the resources we use and minimize unneeded pauses (e.g., we wait() for ASTs to parse on the worker threads, keeping workers from doing useful work).

I'm currently working on revamped threading implementation in clangd, so I suggest waiting before it lands. (I'll make sure to update this thread when it does).
I'll also keep an eye on whether we would be able to reuse the ThreadPool in the new implementation.

On Wed, Nov 29, 2017 at 11:33 AM, Jan Korous via cfe-dev <[hidden email]> wrote:
Hi all,

I am wondering about the fact that there is an implementation of asynchronous message queue (ClangdScheduler) in clangd which in principle is similar to what ThreadPool in LLVM Support does. I just wanted to ask what other people think about possibility of using ThreadPool in clangd as we could potentially spare some resources on maintaining only one version. It’s not a lot of code and those two implementations are not exactly the same so some one-time effort would be needed but it still might be worthwhile.




Regards,
Jan

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




--
Regards,
Ilya Biryukov


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev