Hello, I'm interested in development of multi threaded applications using LLVM. I would like to ask, is there a possibility in LLVM to create several threads, executing software concurrently, while sharing the same memory space? If yes, on which level this can be done (e.g. context, execution engine,...)? Best regards, Jasmin JAHIC -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140530/e21b2345/attachment.html>
Hi Jasmin, Creating threads is the responsibility of the operating system or runtime system. It will provide functions that can be called from assembly language or from a language such as C. You can of course write such C programs (or other languages) and then compile them using Clang & LLVM, but LLVM itself does not know what, for example, pthread_create() means. It's just a library function. On Fri, May 30, 2014 at 8:46 PM, Jasmin Jahic <jasmin.jahic at gmail.com> wrote:> Hello, > > I'm interested in development of multi threaded applications using LLVM. I > would like to ask, is there a possibility in LLVM to create several > threads, executing software concurrently, while sharing the same memory > space? > If yes, on which level this can be done (e.g. context, execution > engine,...)? > > Best regards, > Jasmin JAHIC > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140530/82c5c41c/attachment.html>
Hi Bruce, thank you for your answer. What I want to know is following: Imagine that I create threads in some way. I want threads to execute the same BC, while using the same memory space. I know that LLVM IR has a nice structure: Context - Module - Execution engine. Is there a way to run several instances of LLVM (using threads for example) with the same memory space? On Fri, May 30, 2014 at 11:18 AM, Bruce Hoult <bruce at hoult.org> wrote:> Hi Jasmin, > > Creating threads is the responsibility of the operating system or runtime > system. It will provide functions that can be called from assembly language > or from a language such as C. > > You can of course write such C programs (or other languages) and then > compile them using Clang & LLVM, but LLVM itself does not know what, for > example, pthread_create() means. It's just a library function. > > > On Fri, May 30, 2014 at 8:46 PM, Jasmin Jahic <jasmin.jahic at gmail.com> > wrote: > >> Hello, >> >> I'm interested in development of multi threaded applications using LLVM. >> I would like to ask, is there a possibility in LLVM to create several >> threads, executing software concurrently, while sharing the same memory >> space? >> If yes, on which level this can be done (e.g. context, execution >> engine,...)? >> >> Best regards, >> Jasmin JAHIC >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140530/99159f17/attachment.html>
AFAIK, LLVM supports concurrent execution of its API on the LLVM Context level. You can see http://llvm.org/docs/ProgrammersManual.html#threads-and-llvm Alexey 2014-05-30 12:18 GMT+03:00 Bruce Hoult <bruce at hoult.org>:> Hi Jasmin, > > Creating threads is the responsibility of the operating system or runtime > system. It will provide functions that can be called from assembly language > or from a language such as C. > > You can of course write such C programs (or other languages) and then > compile them using Clang & LLVM, but LLVM itself does not know what, for > example, pthread_create() means. It's just a library function. > > > On Fri, May 30, 2014 at 8:46 PM, Jasmin Jahic <jasmin.jahic at gmail.com> > wrote: > >> Hello, >> >> I'm interested in development of multi threaded applications using LLVM. >> I would like to ask, is there a possibility in LLVM to create several >> threads, executing software concurrently, while sharing the same memory >> space? >> If yes, on which level this can be done (e.g. context, execution >> engine,...)? >> >> Best regards, >> Jasmin JAHIC >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140530/9ca0962e/attachment.html>