Lazarus

Free Pascal => General => Topic started by: Gautam on April 20, 2014, 12:39:17 am

Title: Concurrency/Multicore support?
Post by: Gautam on April 20, 2014, 12:39:17 am
Hi Pascellers (Pascellites? Pascellians?),

Does FPC provide any support for writing highly concurrent code? I don't care whether it is implemented in the traditional lock based model like in Java, or a message passing style like in Go/Erlang. I am just interested in being able to take advantage of multicore architectures for high performance gaming/scientific applications, and also in being able to use multithreaded to create more responsive UIs. Thanks!
Title: Re: Concurrency/Multicore support?
Post by: Leledumbo on April 20, 2014, 03:32:42 am
There's an MPICH2 binding (http://wiki.freepascal.org/MPICH) available for distributed computing, multithreading (http://www.freepascal.org/docs-html/prog/progch10.html) is supported at RTL and language level (for TLS), mutex/lock/critical section is available as well, both procedural (http://www.freepascal.org/docs-html/rtl/system/trtlcriticalsection.html) and OOP (http://www.freepascal.org/docs-html/fcl/syncobjs/index.html) version. This wiki article (http://wiki.freepascal.org/Multithreaded_Application_Tutorial) is a good tutorial.