2)我知道Linux使用扁平线性模型,即以非常有限的方式使用分割。此外,根据Daniel P.Bovet和Marco Cesati的"Understanding the Linux Kernel“,GDT中有四个主要部分:用户数据、用户代码、内核数据和内核代码。所有四个网段的大小和基址都相同。我不明白如果它们只在类型和访问权限上不同(它们都产生相同的线性地址,对吗?),为什么需要其中四个。为什么不只使用其中一个,并将其描述符写到所有段寄存器?
我查找了几个如何创建单实例应用程序的示例,它们都使用了QSharedMemory的create()和attach()方法。为什么他们需要attach()?bool SingleInstanceApplication::useSharedMemory() _sharedMemory.setKey(_uniqueKey);
// no other application instace is running
bool hasNo