Approach for teaching concurrency in Python

Thesis title: Návrh koncepce výuky využívání paralelismu v jazyku Python
Author: Salavec, Jakub
Thesis type: Diplomová práce
Supervisor: Pecinovský, Rudolf
Opponents: Suchan, Vladimír
Thesis language: Česky
Abstract:
Tématem této diplomové práce je navržení koncepce výuky pro výuku souběžně prováděných operací v jazyku Python. Součástí standardní knihovny jazyka Python jsou tři moduly umožňující programování souběžně prováděných operací – threading, multiprocessing a asyncio. Na českých veřejných vysokých školách poskytujících vzdělání v oboru informačních technologií není vyučován žádný kurz zaměřený na výuku souběžně prováděných operací a paralelismu v jazyku Python, a pouze v rámci jednoho vyučovaného předmětu jsou zmíněny všechny tři moduly standardní knihovny. Hlavním cílem této práce je návrh koncepce výuky skládající se z osnovy a demonstračních příkladů, která usnadní proces implementace výuky problematiky souběžně prováděných operací v jazyku Python. Koncepce je převážně cílena na Vysokou školu ekonomickou v Praze, ale během fáze ověření výstupů nebyla získána žádná data ukazující na sníženou efektivitu této koncepce na studenty jiných vysokých škol. Pomocí rešerše literatury byly analyzovány možnosti jazyka Python týkající se souběžně prováděných operací a paralelismu. Metodou systematic mapping study byla provedena analýza současného stavu výuky problematiky této práce za využití zveřejňovaných sylabů předmětů. Na základě těchto dvou analýz byla definována východiska pro tvorbu koncepce výuky. Byla navržena osnova obsahující vícevláknový přístup, multiprocessing i asynchronní programování. Důraz je kladen na pochopení základních principů souběžně prováděných operací, paralelismu a odlišností jazyka Python způsobených Global Interpreter Lockem. Pro podpoření této osnovy bylo navrženo celkem 22 demonstračních příkladů. Tyto příklady, je-li to možné, využívají knihovnu robotů Karel, která je v současné době používána pro demonstrační příklady v předmětu Programování v jazyku Python Vysoké školy ekonomické v Praze. Knihovna poskytuje grafické rozhraní umožňující sledovat, jakým způsobem se jednotliví roboti chovají a pohybují. Koncepce byla následně ověřena na 8 studentech formou pre-assessment a post-assessment dotazníků ve formě testu znalostí dané problematiky. Přednáška dle navržené osnovy s využitím demonstračních příkladů byla realizována mezi těmito dotazníky. Každá testová otázka byla ohodnocena maximálně jedním bodem. Průměrné zlepšení respondentů bylo ve výši 0,5 bodu na otázku. Na závěr jsou diskutovány možné úpravy koncepce, které mohou vést k předání více znalostí studentům.
Keywords: Python; výuka; paralelní programování; souběžně prováděné operace; asyncio
Thesis title: Approach for teaching concurrency in Python
Author: Salavec, Jakub
Thesis type: Diploma thesis
Supervisor: Pecinovský, Rudolf
Opponents: Suchan, Vladimír
Thesis language: Česky
Abstract:
The focus of this thesis is to design a learning concept for teaching concurrent operations in Python. The standard Python library includes three modules that allow programming concurrent operations - threading, multiprocessing and asyncio. There is no course focused on teaching concurrent operations and parallelism in Python taught at Czech public universities providing education in information technology, and only one course mentions all three modules of the standard library. The main objective of this paper is to propose a teaching approach consisting of a syllabus and illustrative examples to facilitate the process of implementing the teaching of concurrent operations issues in Python. The concept is mainly targeted at the University of Economics in Prague, but during the validation phase no data was obtained showing reduced effectiveness of the concept on students of other universities. Using a literature review, the capabilities of Python regarding concurrent operations and parallelism were analyzed. A systematic mapping study method was used to analyze the current state of teaching the issues of this thesis using published course syllabi. On the basis of these two analyses, a starting point for the development of the teaching design was defined. A curriculum including a multi-threaded approach, multiprocessing and asynchronous programming was proposed. Emphasis is placed on understanding the basic principles of concurrent operations, parallelism and the differences in Python caused by Global Interpreter Lock. A total of 22 illustrative examples have been designed to support this curriculum. These examples, where possible, make use of the Karel robot library, which is currently used for illustrative examples in the Programming in Python course at the University of Economics in Prague. The library provides a graphical interface to see how individual robots behave and move. The concept was subsequently tested on 8 students in the form of pre-assessment and post-assessment questionnaires in the form of a test of knowledge of the subject. A lecture according to the proposed curriculum using illustrative examples was conducted between these questionnaires. Each test question was scored with a maximum of one point. The average improvement of the respondents was 0.5 points per question. Finally, possible modifications to both the curriculum and the illustrative examples that may lead to the transfer of more knowledge to the students were discussed.
Keywords: Python; teaching; parallel programming; concurrency; asyncio

Information about study

Study programme: Informační systémy a technologie/Vývoj informačních systémů
Type of study programme: Magisterský studijní program
Assigned degree: Ing.
Institutions assigning academic degree: Vysoká škola ekonomická v Praze
Faculty: Faculty of Informatics and Statistics
Department: Department of Information Technologies

Information on submission and defense

Date of assignment: 29. 10. 2023
Date of submission: 27. 6. 2024
Date of defense: 2024

Files for download

The files will be available after the defense of the thesis.

    Last update: