Analysis of Synchronization Mechanisms in Operating Systems

Oluwatoyin Kode, Temitope Oyemade
{"title":"Analysis of Synchronization Mechanisms in Operating Systems","authors":"Oluwatoyin Kode, Temitope Oyemade","doi":"arxiv-2409.11271","DOIUrl":null,"url":null,"abstract":"This research analyzed the performance and consistency of four\nsynchronization mechanisms-reentrant locks, semaphores, synchronized methods,\nand synchronized blocks-across three operating systems: macOS, Windows, and\nLinux. Synchronization ensures that concurrent processes or threads access\nshared resources safely, and efficient synchronization is vital for maintaining\nsystem performance and reliability. The study aimed to identify the\nsynchronization mechanism that balances efficiency, measured by execution time,\nand consistency, assessed by variance and standard deviation, across platforms.\nThe initial hypothesis proposed that mutex-based mechanisms, specifically\nsynchronized methods and blocks, would be the most efficient due to their\nsimplicity. However, empirical results showed that reentrant locks had the\nlowest average execution time (14.67ms), making them the most efficient\nmechanism, but with the highest variability (standard deviation of 1.15). In\ncontrast, synchronized methods, blocks, and semaphores exhibited higher average\nexecution times (16.33ms for methods and 16.67ms for blocks) but with greater\nconsistency (variance of 0.33). The findings indicated that while reentrant\nlocks were faster, they were more platform-dependent, whereas mutex-based\nmechanisms provided more predictable performance across all operating systems.\nThe use of virtual machines for Windows and Linux was a limitation, potentially\naffecting the results. Future research should include native testing and\nexplore additional synchronization mechanisms and higher concurrency levels.\nThese insights help developers and system designers optimize synchronization\nstrategies for either performance or stability, depending on the application's\nrequirements.","PeriodicalId":501333,"journal":{"name":"arXiv - CS - Operating Systems","volume":"191 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-09-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Operating Systems","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2409.11271","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

This research analyzed the performance and consistency of four synchronization mechanisms-reentrant locks, semaphores, synchronized methods, and synchronized blocks-across three operating systems: macOS, Windows, and Linux. Synchronization ensures that concurrent processes or threads access shared resources safely, and efficient synchronization is vital for maintaining system performance and reliability. The study aimed to identify the synchronization mechanism that balances efficiency, measured by execution time, and consistency, assessed by variance and standard deviation, across platforms. The initial hypothesis proposed that mutex-based mechanisms, specifically synchronized methods and blocks, would be the most efficient due to their simplicity. However, empirical results showed that reentrant locks had the lowest average execution time (14.67ms), making them the most efficient mechanism, but with the highest variability (standard deviation of 1.15). In contrast, synchronized methods, blocks, and semaphores exhibited higher average execution times (16.33ms for methods and 16.67ms for blocks) but with greater consistency (variance of 0.33). The findings indicated that while reentrant locks were faster, they were more platform-dependent, whereas mutex-based mechanisms provided more predictable performance across all operating systems. The use of virtual machines for Windows and Linux was a limitation, potentially affecting the results. Future research should include native testing and explore additional synchronization mechanisms and higher concurrency levels. These insights help developers and system designers optimize synchronization strategies for either performance or stability, depending on the application's requirements.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
操作系统中的同步机制分析
本研究分析了 MacOS、Windows 和 Linux 三种操作系统中四种同步机制--反向锁、信号、同步方法和同步块的性能和一致性。同步能确保并发进程或线程安全地访问共享资源,高效的同步对保持系统性能和可靠性至关重要。最初的假设认为,基于互斥机制(特别是同步方法和区块)因其简单性将是最高效的。然而,实证结果表明,可重入锁的平均执行时间最短(14.67ms),是效率最高的机制,但其变异性也最高(标准偏差为 1.15)。相比之下,同步方法、块和 Semaphores 的平均执行时间较长(方法为 16.33ms,块为 16.67ms),但一致性较高(方差为 0.33)。研究结果表明,虽然重入锁的速度更快,但它们更依赖于平台,而基于mutex的机制在所有操作系统中都能提供更可预测的性能。未来的研究应包括本机测试,并探索更多同步机制和更高的并发级别。这些见解有助于开发人员和系统设计人员根据应用程序的要求,优化同步策略,以提高性能或稳定性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Analysis of Synchronization Mechanisms in Operating Systems Skip TLB flushes for reused pages within mmap's eBPF-mm: Userspace-guided memory management in Linux with eBPF BULKHEAD: Secure, Scalable, and Efficient Kernel Compartmentalization with PKS Rethinking Programmed I/O for Fast Devices, Cheap Cores, and Coherent Interconnects
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1