Show simple item record

dc.contributor.advisorGeyer, Claudio Fernando Resinpt_BR
dc.contributor.authorPereira, Felipe Zorzopt_BR
dc.date.accessioned2021-07-06T04:46:00Zpt_BR
dc.date.issued2021pt_BR
dc.identifier.urihttp://hdl.handle.net/10183/223221pt_BR
dc.description.abstractConcorrência é um conceito essencial para a escrita de programas reativos, rápidos e interativos. Atualmente, entretanto, existe uma grande quantidade de linguagens de programação que oferecem mecanismos de concorrência. A partir daí surge o objetivo desse trabalho: realizar uma avaliação sistemática de mecanismos de concorrência e sincronização de algumas das mais populares linguagens de programação de propósito geral, a fim de ajudar programadores a fazerem decisões informadas sobre quais linguagens melhor se adequam às suas necessidades de concorrência. As linguagens analisadas nesse trabalho são C++, Go, Java, Kotlin e Scala. A avaliação delas é feita com base em dados obtidos sobre as métricas de overhead da concorrência e da sincronização, speedup e justiça. Tais dados foram coletados por meio da execução de programas implementados usando as linguagens e os seus mecanismos. Para analisar os overheads simplesmente se comparou o desempenho de laços vazios e de laços que criam tarefas concorrentes ou entram e saem de seções críticas; para o speedup implementou-se a multiplicação de matrizes; por fim, para a justiça foi utilizado o problema dos filósofos. Os programas foram executados em duas máquinas com processadores e sistemas operacionais distintos, a fim de confirmar que as conclusões obtidas não são dependentes da plataforma utilizada. Os resultados demonstram que as linguagens com menos overhead de concorrência foram Go e Kotlin, com Scala ficando muito atrás das demais linguagens. Os overheads de sincronização de todas as linguagens são extremamente baixos, sendo aceitáveis para a grande maioria das aplicações; apesar disso, Scala ficou bem atrás das demais linguagens. Quanto ao speedup, considera-se que as threads de Java obtiveram os resultados mais constantes ao longo dos experimentos nas duas máquinas. Os experimentos para avaliar a justiça das linguagens obtiveram resultados bem esparsos, sendo difícil escolher uma linguagem como sendo a melhor. Entretanto, Java, assim como as linguagens baseadas em Java (Scala e Kotlin), se destacaram. Por fim, conclui-se que Java e Kotlin foram as linguagens com os melhores resultados gerais. Se o maior objetivo da concorrência é proporcionar speedup, recomenda-se Java; se, por outro lado, o programa exige a criação de dezenas ou centenas de milhares de tarefas concorrentes, recomenda-se Kotlin.pt_BR
dc.description.abstractConcurrency is an essential concept to the writing of reactive, fast and interactive programs. Nowadays, however, a great variety of programming languages offers concurrency mechanisms. From this emerges the objective of this work: to perform a systematic evaluation of concurrency and synchronization mechanisms of some of the most popular general-purpose programming languages, in order to help programmers make informed decisions on which languages best suit their needs for concurrency. The languages analyzed in this work are C++, Go, Java, Kotlin and Scala. Their evaluation is done based on data collected about their overhead, speedup and fairness. This data was collected through the execution of programs implemented using the languages and their mechanisms. To analyze the overhead of the languages, empty loops were compared to loops that create concurrent tasks or enter and leave critical sections; to analyze the speedup, matrix multiplication was implemented; lastly, the dining philosophers problem was used to analyze the fairness of the languages. The programs were executed in two different machines with different processors and operating systems, with the intention of confirming that the conclusions obtained are not dependent on the underlying platform. The results show that the languages with the least concurrency overhead are Go and Kotlin, with Scala's performance being way behind the other languages. The synchronization overhead of all the languages is extremely low, being acceptable to the majority of applications; Scala, however, stood way behind the other languages once again. Regarding the speedup it is considered that Java's threads had the most consistent results during the experiments on both machines. The experiments that evaluate the languages' fairness had very sparse results. Therefore, it is difficult to choose one language as the fairest. Despite of that, Java, as well as the Java-based languages (Scala and Kotlin), stood out. Finally, it is concluded that Java and Kotlin were the languages with the best overall results. If the main objective of concurrency is speedup, Java is recommended; if, on the other hand, the program requires the creation of dozens or hundreds of thousands of concurrency tasks, Kotlin is recommended.en
dc.format.mimetypeapplication/pdfpt_BR
dc.language.isoengpt_BR
dc.rightsOpen Accessen
dc.subjectC++en
dc.subjectLinguagens de programaçãopt_BR
dc.subjectSincronizacaopt_BR
dc.subjectGoen
dc.subjectParalelismopt_BR
dc.subjectJavaen
dc.subjectThreadspt_BR
dc.subjectKotlinen
dc.subjectConcorrênciapt_BR
dc.subjectScalaen
dc.subjectGoroutinesen
dc.subjectCoroutinesen
dc.subjectMutexen
dc.subjectSpeedupen
dc.titleAvaliação de concorrência e sincronização de diferentes linguagens de programação popularespt_BR
dc.title.alternativeConcurrency and synchronization evaluation of different programming languages pt
dc.typeTrabalho de conclusão de graduaçãopt_BR
dc.identifier.nrb001126941pt_BR
dc.degree.grantorUniversidade Federal do Rio Grande do Sulpt_BR
dc.degree.departmentInstituto de Informáticapt_BR
dc.degree.localPorto Alegre, BR-RSpt_BR
dc.degree.date2020pt_BR
dc.degree.graduationCiência da Computação: Ênfase em Ciência da Computação: Bachareladopt_BR
dc.degree.levelgraduaçãopt_BR


Files in this item

Thumbnail
   

This item is licensed under a Creative Commons License

Show simple item record