实验弱有序并发的工具 [英] Tools to experiment with weakly ordered concurrency

查看:167
本文介绍了实验弱有序并发的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么工具可以帮助我们尝试使用弱顺序并发? 也就是说,在教授自己关于部分栅栏,弱原子,获取/消费/释放语义的时候, -free算法等?

What tools exist to help one to experiment with weakly ordered concurrency? That is, in what sandbox can one play while teaching oneself about partial fences, weak atomics, acquire/consume/release semantics, lock-free algorithms and the like?

工具或沙箱想要锻炼和强调一个弱有序的线程算法,揭示算法在理论上可能失败的各种方式。以物理方式运行在x86上,例如,该工具将能够暴露ARM类型的失败。

The tool or sandbox one wants would exercise and stress one's weakly ordered, threaded algorithm, exposing the various ways in which the algorithm might theoretically fail. Physically running on an x86, for example, the tool would nevertheless be able to expose ARM-type failures.

一个开源工具是更可取的。

An open-source tool would be preferable. Please advise.

参考文献:

  • the C++11 draft standard (PDF, see clauses 1, 29 and 30);
  • Hans-J. Boehm's overview of the subject;
  • McKenney, Boehm and Crowl on the subject;
  • GCC's developmental notes on the subject;
  • the Linux kernel's notes on the subject;
  • a related question with answers here on Stackoverflow
  • another question, this one comparing fences against atomics;
  • Cppmem (on the advice of @KerrekSB);
  • Cppmem's help page;
  • Spin (a tool for analyzing the logical consistency of concurrent systems, on the advice of @JohnZwinck).

(引用面向C ++ 11,因为这是我碰巧遇到的问题。但是,对我所知,非C ++的答案可能是最好的,所以随意扩展你的答案超越C ++,你认为合适。)

(The references are oriented toward C++11 because this is how I happen to have approached the subject. However, for all I know, a non-C++ answer might be best, so feel free to extend your answer beyond C++ as you see fit.)

推荐答案

这是一个比你的问题直接询问一点更一般,但看看旋转,一个模型检查器的并发系统。在线手册在这里: http://spinroot.com/spin/Man/Manual.html

This is quite a bit more general than what your question directly asks, but take a look at "Spin," a "model checker" for concurrent systems. An online manual is here: http://spinroot.com/spin/Man/Manual.html

你可能觉得它有点老派的感觉,但我没有理由不适合你的工作,感兴趣的。因为它是相当一般的,但是,你可能需要做一点工作来教这个工具关于问题空间。好消息是它是平台无关的。坏消息是你可能需要明确地建模每个计算机体系结构(例如,Spin本质上不知道ARM和x86的保证)。但也许有些工作已经在其他地方完成(我没有检查),和/或你可以分享你做什么,所以其他人可能会受益。这个工具毕竟是开源的。

You will probably find it to be a bit "old school" in feel, but I see no reason why it wouldn't be suitable for the jobs you're interested in. Since it is quite general, however, you may need to do a bit of work to teach the tool about the problem space. The good news is that it is platform-independent. The bad news is you'd probably need to model each computer architecture explicitly (Spin doesn't intrinsically know about the guarantees of ARM vs. x86, for example). But maybe some of that work has been done elsewhere (I didn't check), and/or you could share pieces of what you do so others may benefit. The tool is open-source, after all.

这篇关于实验弱有序并发的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆