Search code examples
algorithmprogramming-languagesparallel-processing

Python, Java, C# and parallel algorithms


I was wondering: would there be any merit in attempting to create parallel algorithms in Python? Say I want to research a new parallel algorithm, and I have the choice of C, C# and Python, would one or the other be "better" to test and benchmark these algorithms, or they are just "functionally equivalent" and, besides the constants associated to interpreted/compiled/vm languages, it would all be the same? Thanks


Solution

  • Python is not suitable for this because of global interpreter lock (GIL), it doesn't work this way. C is hard to use in multithreaded environment, but there is an alternative - Cilk language. C# is a pretty nice choice for parallel programming. You can use Task Parallel Library, concurrent data structures and PLINQ from .NET Framework 4.