English 中文(简体)
如何在C++中建立校对机制?
原标题:How make a threading mechanism in C++?

我知道,像Pthread一样,C++有一些翻新的图书馆。 在那里,她们如何工作? 必须在某个地方执行逻辑。

我要说的是,我要写一下我自己在C++的翻新机制,而不是使用任何图书馆,我会如何开始? 在撰写本报告时,我想到什么?

最佳回答
问题回答

In C++98/03, there is no notion of a "thread", so the question cannot be answered within the language. In C++11, the answer is to use <thread>.

在实施方面,翻新是一个运行系统的特点。 运行系统已经必须安排多个网站 (即单独的方案)和一个多读式的非洲顾问办公室,使在一个进程内安排多个网站<><>>。 作为一个核心问题,本组织可能或可能无法利用一个以上CPU(尽管这也适用于简单的多处理;相反,你可以安排在一个单一的CPU上多管。 在方案拟定的核心,你们将需要硬件支持像原子读/美术和原子比较和交换等分机,以实施正确的记忆存取。 (not need for only multi-process,因为不同的过程有不同的记忆;will 如果存在多个实际使用集装箱清单,则需要该办公室本身。

你可以书写你自己的阅读机制,除非你指像同rou一样的伪装,而不是实际的 concurrently子。 这是因为根本的read子机制是由ker子界定的,你可以改变这种机制,也不能自行实施。 你书写的任何图书馆最终必须回到操作系统。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签