跳到主要导航 跳到搜索 跳到主要内容

Comparative modelling and verification of Pthreads and Dthreads

  • Yuan Fei
  • , Huibiao Zhu*
  • , Xi Wu
  • , Huixing Fang
  • , Shengchao Qin
  • *此作品的通讯作者
  • Shanghai Key Laboratory of Trustworthy Computing
  • East China Normal University
  • School of Information Technology and Electrical Engineering
  • University of Queensland
  • School of Information Engineering
  • Yangzhou University
  • School of Computing
  • Teesside University
  • School of Computer Science and Software Engineering
  • Shenzhen University

科研成果: 期刊稿件 › 文章 › 同行评审

摘要

The POSIX threads (Pthreads) library is a thread API for C/C++ to control parallel threads and spawn concurrent process flows. Programming in Pthreads usually suffers from undesirable deadlock, data race, and race condition problems due to the potential nondeterministic execution behaviors between parallel threads. Dthreads, as another multithreading model that re-implements Pthreads, was proposed by Liu et al for efficient deterministic multithreading. They found out that, under specific test cases, Dthreads can effectively prevent data races. However, no comparison test has been made with Pthreads. To perform a formal comparison between Pthreads and Dthreads over deadlocks, data races, and race conditions, in this paper, we adopt CSP (communicating sequential processes) as a formal model for specifying part of API functions in Pthreads and Dthreads and illustrate the model construction using 4 classical example programs. By feeding the models into the model checker PAT (process analysis toolkit), we have verified that deadlocks and data races exist in Pthreads, but do not exist in Dthreads, for the considered programs. We have also found that neither of them can prevent race conditions. Our comparative modelling and verification of Pthreads and Dthreads show that though Dthreads cannot prevent all the deadlock situations, shown by verification results of another 2 example programs, Dthreads is better than Pthreads on eliminating data races and preventing deadlocks. Considering limited scalability of Dthreads, we have introduced a new programming model to support coarse granularity in bank transfer. Our modelling is also extended by covering the synchronization operations in Liu et al work.

源语言英语
期刊论文编号e1919
期刊Journal of Software: Evolution and Process
卷30
期3
DOI
出版状态已出版 - 3月 2018

学术指纹

探究 'Comparative modelling and verification of Pthreads and Dthreads' 的科研主题。它们共同构成独一无二的学术指纹。

引用此