shared

When to use Shared methods in .NET

北城余情 提交于 2019-12-22 06:57:23
问题 I'm get kind of getting mixed messages about this so I'm hoping someone can clear this up for me. Should I be using Shared methods/functions in the following situation: I have a generic class named "Person". This class represents a person in the database. I have a manager class named "PersonManager". This class contains methods which adds, updates, deletes individual Person objects. A method also exists to lookup Persons from the database. Should these methods in the manager class be declared

NUMA-aware named shared memory for Linux

家住魔仙堡 提交于 2019-12-22 06:29:11
问题 The Windows API offers the CreateFileMappingNuma function (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366539(v=vs.85).aspx) to create a named shared memory space on a specific NUMA node. So far, I have not found an equivalent function for Linux. My current approach looks like this: Allocate named shared memory (using shm_open(...)) Determine current NUMA node (using numa_move_pages(...)) Move pages to target Node (using numa_move_pages(...) again) Does anyone know a better

NUMA-aware named shared memory for Linux

点点圈 提交于 2019-12-22 06:29:07
问题 The Windows API offers the CreateFileMappingNuma function (http://msdn.microsoft.com/en-us/library/windows/desktop/aa366539(v=vs.85).aspx) to create a named shared memory space on a specific NUMA node. So far, I have not found an equivalent function for Linux. My current approach looks like this: Allocate named shared memory (using shm_open(...)) Determine current NUMA node (using numa_move_pages(...)) Move pages to target Node (using numa_move_pages(...) again) Does anyone know a better

Force linking a static library into a shared one with Libtool

喜欢而已 提交于 2019-12-21 07:37:36
问题 I have a library ( libfoo ) that is compiled using libtool into two objects: libfoo.a and libfoo.so. I have to create, using libtool also, another library ( libbar ) that will be a single shared library (libbar.so) containing all libfoo's code. In order to do this, I have to force libbar to link against libfoo.a , and not libfoo.so. I am in an autotools environment, so I have to solve this using standard configure.in or Makefile.am rules. I tried several things, like in configure.in : LDFLAGS

C++ raw pointer and std::shared_ptr

偶尔善良 提交于 2019-12-21 07:02:14
问题 I am working with std::shared_ptr and during my software development I met a couple of cases that let me doubt about memory management. I had a third party library that gave me always raw pointers from functions and in my code I was transforming them into std::shared_ptr (from std and not from boost. By the way what is the difference between the two?). So let's say I have the following code: ClassA* raw = new ClassA; std::shared_ptr<ClassA> shared(raw); What happens now when the shared

how to link shared library against other shared library in linux?

你。 提交于 2019-12-21 02:25:06
问题 My application dynamically loads liba.so (with dlopen ). liba.so uses libb.so so I want to link liba.so against libb.so . How to do this in Linux? Thanks in advance. 回答1: If you build liba.so yourself, you need to link it with -l option gcc -o liba.so liba.o -L/libb/path -lb If you don't have liba sources, perhaps you could create libawrapper.so linked against liba and libb and to load dynamically this library gcc -o libawrap.so -L/liba/ -L/libb/ -la -lb 来源: https://stackoverflow.com

shared_ptr & weak_ptr conversions

别说谁变了你拦得住时间么 提交于 2019-12-20 18:58:23
问题 I am trying to juggle objects using std::shared_ptr and std::weak_ptr . The scenario is something like this: I have objects of class channel which is derived from a abstract class abstract::channel (with pure virtual functions). I have a container channelContainer ( std::vector ) containing shared pointers ( std::shared_ptr ) to channel Objects. Now, I have a deque (std::deque) containing weak pointers (std::weak_ptr) to each of the object in the channelContainer . Lets name this deque

Program to view Shared Memory in Windows?

五迷三道 提交于 2019-12-20 14:06:30
问题 I'm looking for a program to view and browse the (local) shared memory in Windows x32/x64. I know this exists because I've seen it in action before. For some reason Google and MSDN fail me on this one. 回答1: I think Accesschk can do this. From the commandline: accesschk.exe -osv > objects.txt Search for: "Type: Section" 来源: https://stackoverflow.com/questions/465378/program-to-view-shared-memory-in-windows

Shared preferences, where do they go?

不羁岁月 提交于 2019-12-20 05:14:16
问题 I know how shared preferences work but I just dont know where to insert the code in the code below to save the users data.I have a login , background task that does all the work and registration .I want the app to open to a splash page when user logged in.Cant figure it out from other answers Login.java Button bttnLogin; EditText loginEmail, loginPassword; TextView regLink; AlertDialog.Builder alert; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Prevent WNetAddConnection2 class which allows prohibited user to access shared folder

痴心易碎 提交于 2019-12-20 04:29:09
问题 I had developed C# windows application. OS is Windows 7 Requirement: is to access Network Shared Folder ‘Test’ using code with credentials using WNetAddConnection2 class. Restriction: is some users has access of this shared folder ‘Test’, but for other user,‘deny’ sharing permission is set. in code WNetAddConnection2 validates wrong username/password, It will give me error. For example ‘User A’ from LAN is trying to access Shared folder ‘Test’ using run command , He is not able to access