English 中文(简体)
在2个过程中,将自由/住所行动锁定在24个过程中,而不是铺设。
原标题:lock freedom/atomic operations across 2 processes instead of threads

我通过分享记忆,分享多个进程的一些数据;我利用不同进程之间的相互经验实现同步。

My question is the following: is it possible to use lock-free data structures AND/OR atomic operations to achieve faster synchronization without using mutexes between 2 processes?

如果没有,你会知道这样做的主要原因是什么?

它们只用于同步推进同一进程。 这些概念是否也能够适应进程? 如果是没有数据,你知道在各种过程之间分享/同步数据的任何更快的方法?

最佳回答

这些概念是否也能够适应进程?

Yes, atomic operations are universal both for threads and processes, IIF the memory atomically used is shared.

Atomic operation is specific instruction of processor itself and in knows nothing about threads or processes, it is just All-or-nothing (indivisible) complex of actions (read; compare; store) with low-level hardware implementation.

因此,你可以在不同进程之间树立共同的记忆,把原子的东西放在其中。

无锁定

Yes, if 无锁定is implemented only with atomic. (It should)

数据结构

你们应当核实,共享记忆在两个过程(在数据结构中)的同一地址。

如果记忆被绘制成不同的地址,则点数将在另一个过程中打破。 在这种情况下,你需要使用相对地址,并做简单的记忆翻译。

1. 相互程序

我要说的是,glibc>2.4(NPTL)使用futex和原子操作作为非连续锁(用于程序共享面值=过程间歇)。 因此,你已经在共同记忆中利用原子行动。

问题回答

On x86 with NPTL, most of the synchronization primitives have as their fast path just a single interlocked operation with a full memory barrier. Since x86 platforms don t really have anything lighter than that, they are already about the best you can do. Unless the existing atomic operations do exactly what you need to do, there will be no performance boost to pay back the costs of using the semantically lighter primitive.





相关问题
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?

热门标签