没有合适的资源?快使用搜索试试~ 我知道了~
本文深入探讨了多线程c++编程的内存模式,对于学习多线程c++编程的程序员是一个很好的参考.
资源推荐
资源详情
资源评论
Document Number: WG21/N1680=J16/04-0120
Date: 10 September 2004
Reply to: Andrei Alexandrescu
andrei@metalanguage.com
2216 NE 46th St. Apt. A
Seattle WA 98105 USA
Memory model for multithreaded C++
Andrei Alexandrescu Hans Boehm Kevlin Henney
Doug Lea Bill Pugh
Abstract
The C++ Standard defines single-threaded program execution. Fun-
damentally, multithreaded execution requires a much more refined mem-
ory and execution model. C++ threading libraries are in the awkward sit-
uation of specifying (implicitly or explicitly) an extended memory mo de l
for C++ in order to specify program execution. We propose integrating
a memory model suitable for multithreaded execution in the C++ Stan-
dard. On top of that model, we propose a standard threading library.
1 Introduction
Many of today’s applications make use of multithreaded execution. We expect
such use to grow as the increased use of hardware multithreading (a.k.a. “hy-
perthreading”) and multi-core processors will force or entice more and more
applications to become multithreaded. C
++
is commonly used as part of mul-
tithreaded applications, sometimes with either direct calls into an OS-provided
threading library (e.g. POSIX threads (pthreads) [3] or Win32 threads) or with
the aid of an intervening layer that provides a platform-neutral interface (e.g.
Boost Threads). However, concurrent programming is inherently diverse, and
includes high-performance parallel programming, asynchronous task processing,
message-based and event-based systems, non-blocking, lock-free and optimistic
data structures, transactional approaches, and so on.
Unfortunately, programming multithreaded applications of any kind in C
++
remains a black art. Properties critical for reliable, efficient, and correct multi-
threaded execution are left unspecified. The Win32 threading model is notori-
ously underspecified (and by extension, any portable layer that relies on it, such
as Boost Threads). POSIX threads are more rigorously defined, but pthreads
only specify a C binding; C
++
programs using pthreads enjoy vicarious cor-
rectness at best. The C
++
Standard specifies program execution in terms of
observable behavior, which in turn describes sequential execution on an implic-
itly single-threaded abstract machine. Thus, currently, many questions that
programmers have about how to predict and control multithreaded code simply
1
资源评论
Zi_Yuan
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功