Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
A comparative analysis between parallel models in C/C++ and C#/Java: A quantitative comparison between different programming models on how they implement parallism
KTH, School of Information and Communication Technology (ICT).
KTH, School of Information and Communication Technology (ICT).
2013 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesisAlternative title
En komparativ analys mellan parallella modeller i C/C++ och Java/C# (Swedish)
Abstract [en]

Parallel programming is becoming more common in software development with the popularity of multi core processors on the rise. Today there are many people and institutes that develop parallel programming APIs for already existing programming languages. It is difficult for a new programmer to choose which programming language to parallel program in when each programming language has supporting APIs for parallel implementation. Comparisons between four popular programming languages with their respective most common parallel programming APIs were done in this study. The four programming languages were C with OpenMP, C++ with TBB, C# with TPL and Java with fork/join. The comparisons include overall speedup, execution time and granularity tests.

The comparison is done by translating a chosen benchmark to other programming languages as similar as possible. The benchmark is then run and timed based on how long the execution time of the parallel regions. The number of threads are then increased and the execution time of the benchmark is observed. A second test is running the benchmark on different granularity sizes with the constant number of available threads, testing the behavior on how large or fine grained tasks each language can handle.

Results show that the programming language C with OpenMP gave the fastest execution time while C++ gave the best overall speedup in relation to its sequential execution time. Java with fork/join was on par with C and C++ with a slight decay of overall speedup when the number of threads was increased and the granularity became too fine grained. Java could handle the granularity test better than C where it could handle very fine granularity without losing the overall speedup. C# with TPL performed the worst in all scenarios not excelling in any tests.

Abstract [sv]

Med den ökande populariteten av flerkärniga lösningar har parallellprogrammering börjat bli ett mer vanligt tillvägagångssätt att programmera i mjukvaruutveckling. Idag är det många personer och institutioner som utvecklar parallellprogrammerings APIer för redan existerande programmeringsspråk. Det är svårt för en ny programmerare att välja ett programmeringsspråk att parallellprogrammera i när varje programmeringsspråk har stöttande APIer för parallel implementering. I denna studie har fyra populära programmeringsspråk jämförts med deras respektive mest vanliga parallellprogrammerings APIer. De fyra programmeringsspråken var C med OpenMP, C++ med TBB, C# med TPL och Java med fork/join. Jämförelserna innefattar den generella uppsnabbningen, exekveringstiden och kornigheten.

Jämförelsen görs genom att översätta ett utvalt prestandatest till andra programmeringsspråk så lika varandra som möjligt. Prestandatestet körs sedan och tidtagning sker baserat på hur lång exekveringstiden av de parallella regionerna är. Sedan ökas antalet trådar och exekveringstiden av prestandatestet observeras. Ett andra test kör prestandatestet med olika storlek på kornigheten med ett konstant antal möjliga trådar och testar beteendet på hur stor eller liten kornighet på uppgifterna varje språk kan hantera.

Resultaten visar att programmeringsspråket C med OpenMP hade den snabbaste exekveringstiden, medan C++ hade bäst generell uppsnabbning. Java med fork/join höll jämna steg med C och C++ med en lätt tillbakahållning av den generella uppsnabbningen när antalet trådar ökade och kornigheten minskade. Java hanterade kornigheten bättre än C där den kunde hantera väldigt liten kornighet utan att förlora den generella uppsnabbningen. C# med TPL hade sämst resultat i alla scenarion och framstod inte i något utav testerna.

Place, publisher, year, edition, pages
2013. , 94 p.
Series
Trita-ICT-EX, 2013:157
National Category
Engineering and Technology
Identifiers
URN: urn:nbn:se:kth:diva-128606OAI: oai:DiVA.org:kth-128606DiVA: diva2:648395
Educational program
Master of Science in Engineering - Information and Communication Technology
Examiners
Available from: 2013-09-16 Created: 2013-09-16 Last updated: 2013-09-16Bibliographically approved

Open Access in DiVA

fulltext(811 kB)38094 downloads
File information
File name FULLTEXT01.pdfFile size 811 kBChecksum SHA-512
996b14f7d5c47f0f80812bfe7f78fca97f5e2bf713214d1626b3b91cb8d76787dc4bd0941f9a8277a8cc3e5a777a1b01e31f65e7720efeb6193f5989843e2fb1
Type fulltextMimetype application/pdf

By organisation
School of Information and Communication Technology (ICT)
Engineering and Technology

Search outside of DiVA

GoogleGoogle Scholar
Total: 38094 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 474 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf