Technical Report: Unanticipated Object Synchronisation for Dynamically-Typed Languages - Archive ouverte HAL Accéder directement au contenu
Rapport Année : 2022

Technical Report: Unanticipated Object Synchronisation for Dynamically-Typed Languages

Résumé

Developing concurrent programs requires the use of threadsafe abstractions to avoid race conditions. Nevertheless, many libraries are not thread-safe either because it was not a concern for the developer or the developer purposely traded thread-safety for performance. All calls to such a library require to be synchronised in the client program. While different synchronisation mechanisms exist, only lock-based solutions and transaction solutions allow one to add synchronisation without anticipation. But they are both about reasoning in terms of execution. It forces developers to explore the whole execution to identify when synchronisation is required. A developer accidentally missing a synchronisation point circumvents the mechanism. Instead by ensuring exclusive access to an object for a thread prevents other thread to access it and thus allows developers to miss synchronisation points without circumventing the mechanism. In this paper, we propose the Atomic Samurai, a synchronisation model that is object-based, unanticipated, and while the object is synchronised the rest of the program normally runs concurrently. It relies on 3 mechanisms: pointer swapping to ensure reference unicity, proxies to control object accesses and late binding to intercept and redirect messages sent. We validate our approach by showing how Atomic Samurai helps both solving examples extracted from the literature and a real-world scenario from the Pharo community on font rendering. We also measure the impact in performance of our solution by comparing it with a semaphore-based solution. In term of performance, our solution is 5 orders of magnitude slower than the semaphore-based solution, but scales better with the number of processes.
Fichier principal
Vignette du fichier
hal-version.pdf (941.44 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-03781743 , version 1 (22-09-2022)

Identifiants

  • HAL Id : hal-03781743 , version 1

Citer

Théo Rogliano, Guillermo Polito, Pablo Tesone, Luc Fabresse, Stéphane Ducasse. Technical Report: Unanticipated Object Synchronisation for Dynamically-Typed Languages. [Technical Report] INRIA Lille - Nord Europe. 2022. ⟨hal-03781743⟩
65 Consultations
47 Téléchargements

Partager

Gmail Facebook X LinkedIn More