用于线程管理的C ++标准 [英] C++ standards for thread management

查看:52
本文介绍了用于线程管理的C ++标准的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我已经在Windows中编写了很多年的代码,所以对它有一种心态,

所以原谅任何愚蠢的问题。


是否有可能用C ++创建一个多线程应用程序,可以移植(OS /编译器)?在我的Windows应用程序中,我使用

同步对象,如互斥锁,信号量等。在标准ANSI C ++中是否有类似的
或者我最好这样做

我自己,可能会创建一个新类来处理任何关键部分

和内存共享等。


关于此主题的任何文章都是也欢迎。


谢谢。

Hi,

I have been coding in Windows for many years so have a mindset to it,
so forgive any stupid questions.

Is it possible to create a multithread application in C++ that is
portable (OS/compiler)? In my Windows applications, I use
synchronization objects like, mutex, semaphores etc. Is there anything
similar in the Standard ANSI C++ or would I be best off doing this
myself, possibly creating a new class to handle any critical sections
and memory sharing etc.

Any articles on this subject are welcome as well.

Thanks.

推荐答案



Morpheus写道:

Morpheus wrote:




我已经在Windows中编写了很多年的代码,所以对它有一种心态,

原谅任何愚蠢的问题。


是否有可能用C ++创建多线程应用程序

portable(OS /编译器)?在我的Windows应用程序中,我使用

同步对象,如互斥锁,信号量等。在标准ANSI C ++中是否有类似的
或者我最好这样做

我自己,可能会创建一个新类来处理任何关键部分

和内存共享等。


关于此主题的任何文章都是也欢迎。
Hi,

I have been coding in Windows for many years so have a mindset to it,
so forgive any stupid questions.

Is it possible to create a multithread application in C++ that is
portable (OS/compiler)? In my Windows applications, I use
synchronization objects like, mutex, semaphores etc. Is there anything
similar in the Standard ANSI C++ or would I be best off doing this
myself, possibly creating a new class to handle any critical sections
and memory sharing etc.

Any articles on this subject are welcome as well.



没有支持线程或同步对象的类型

你在标准C ++中提到。但是,在你从头开始编写你需要的所有内容之前,你可能想看一下线程库

in boost。

< a rel =nofollowhref =http://www.boost.org/doc/html/threads.htmltarget =_ blank> http://www.boost.org/doc/html/threads.html


看看它是否符合您的要求,以及它是否可移植到您需要关注的平台上。

Gavin Deane

There is no support for threads or the kind of synchronisation objects
you mention in standard C++. However, before you write everything you
need from scratch, you might want to have a look at the threads library
in boost.

http://www.boost.org/doc/html/threads.html

See if it does what you want and if it is portable to the platforms you
care about.

Gavin Deane


Morpheus写道:
Morpheus wrote:

是否可以创建C ++中的多线程应用程序是否可以移植(OS /编译器)?在我的Windows应用程序中,我使用

同步对象,如互斥锁,信号量等。在标准ANSI C ++中是否有类似的
或者我最好这样做

我自己,可能会创建一个新类来处理任何关键部分

和内存共享等。


关于此主题的任何文章都是也欢迎。
Is it possible to create a multithread application in C++ that is
portable (OS/compiler)? In my Windows applications, I use
synchronization objects like, mutex, semaphores etc. Is there anything
similar in the Standard ANSI C++ or would I be best off doing this
myself, possibly creating a new class to handle any critical sections
and memory sharing etc.

Any articles on this subject are welcome as well.



查看这篇关于Boost.Threads的文章:

http://www.ddj.com/dept/cpp/184401518


你可能是感兴趣的这篇文章关于线程的未来

标准C ++:

http://www.artima.com/cppsource/threads_meeting.html


干杯! - M

Check out this article on Boost.Threads:

http://www.ddj.com/dept/cpp/184401518

And you might be interested in this article on the future of threads in
standard C++:

http://www.artima.com/cppsource/threads_meeting.html

Cheers! --M


" Morpheus" < ad *********** @ gmail.comwrote in message

news:11 ******************* **@h48g2000cwc.googlegro ups.com ...
"Morpheus" <ad***********@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...




我在Windows中为很多编码所以有一种心态,

原谅任何愚蠢的问题。


是否可以用C ++创建多线程应用程序

portable(OS /编译器)?在我的Windows应用程序中,我使用

同步对象,如互斥锁,信号量等。在标准ANSI C ++中是否有类似的
或者我最好这样做

我自己,可能会创建一个新类来处理任何关键部分

和内存共享等。


关于此主题的任何文章都是也欢迎。
Hi,

I have been coding in Windows for many years so have a mindset to it,
so forgive any stupid questions.

Is it possible to create a multithread application in C++ that is
portable (OS/compiler)? In my Windows applications, I use
synchronization objects like, mutex, semaphores etc. Is there anything
similar in the Standard ANSI C++ or would I be best off doing this
myself, possibly creating a new class to handle any critical sections
and memory sharing etc.

Any articles on this subject are welcome as well.



以下是一些相关信息的链接:

http://groups.google.com/group/comp=\"d30a778b43f2c5
http://groups.google.com/group/comp .... f096adecdd0369

(参考帖子的最后部分......)
http://groups-beta.google.com/group/...3df394a0370fa6


FWIW,我在一篇非常粗略的论文草稿中提出了这个问题,我目前正在讨论这个问题。这是原始草案的链接:

http://appcore.home.comcast.net/vzdo...c/static-init/

它不完整,但是,''你应该感兴趣...

有什么想法吗?


Here are some link to some relevant information:

http://groups.google.com/group/comp....d30a778b43f2c5
http://groups.google.com/group/comp....f096adecdd0369
(refer to last part of the post...)
http://groups-beta.google.com/group/...3df394a0370fa6

FWIW, I raise this issue in a very rough draft of a paper I am currently
working on. Here is a link to the crude draft:

http://appcore.home.comcast.net/vzdo...c/static-init/

Its incomplete, however, what''s there should be of interest to you...
Any thoughts?



这篇关于用于线程管理的C ++标准的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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