Questions tagged [shared]

In VB.NET, the Shared keyword is roughly equivalent to the static keyword used by many other languages.

In , the Shared keyword is roughly equivalent to the static keyword used by and many other languages.

For example, the following code snippet in VB.NET:

Public Class Foo
    Public Shared Bar As String
End Class

Is equivalent to the C#:

public class Foo
{
    public static string Bar;
}

Further Reading

OpenMP

In OpenMP, it corresponds to the status of a variable. In a parallel section, a SHARED variable will be shared by all the running threads, meaning they will all access this variable and could modify it simultaneously. It is the default status of every variable in a parallel section, apart from the iteration counters.

1404 questions
179
votes
5 answers

Is it possible to get CMake to build both a static and shared library at the same time?

Same source, all that, just want a static and shared version both. Easy to do?
gct
  • 14,100
  • 15
  • 68
  • 107
134
votes
6 answers

Use numpy array in shared memory for multiprocessing

I would like to use a numpy array in shared memory for use with the multiprocessing module. The difficulty is using it like a numpy array, and not just as a ctypes array. from multiprocessing import Process, Array import scipy def f(a): a[0] =…
Ian Langmore
  • 2,819
  • 5
  • 21
  • 20
108
votes
5 answers

How to configure an existing git repo to be shared by a UNIX group

I have an existing git repo (a bare one) which has up to this point only been writable by me. I want to open it up to some UNIX user group, foo, so that all members of foo can push to it. I'm aware that I can easily set up a new git repo with: git…
Pistos
  • 23,070
  • 14
  • 64
  • 77
101
votes
3 answers

Push git changes to a shared network drive

How can a team of four people use Git (specifically Github for Windows) to push local changes to a shared network drive? Right now (without Git) we have to copy the files from the network drive to our local machine, edit the files, and then…
user1549303
  • 1,019
  • 2
  • 8
  • 3
59
votes
2 answers

How to get the Object being pointed by a shared pointer?

I have a query. Can we get the object that a shared pointer points to directly? Or should we get the underlying RAW pointer through get() call and then access the corresponding object?
Pavan Dittakavi
  • 3,013
  • 5
  • 27
  • 47
55
votes
2 answers

How to share keychain data between iOS applications

I am describing a problem for which it took me quite some time to learn the answer. The "GenericKeychain" example is a good start at providing a wrapper for sharing keychain data between applications when using the accessGroup in the init. However,…
GtotheB
  • 2,727
  • 4
  • 21
  • 17
54
votes
3 answers

Is there a Windows/MSVC equivalent to the -rpath linker flag?

On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables. Can this also be accomplished on Windows? As far as I know, dlls are always searched in the executable's…
Shamoha
51
votes
8 answers

How to start Solr automatically?

At the moment I have to go to /usr/java/apache-solr-1.4.0/example and then do: java -jar start.jar How do I get this to start automatically on boot? I'm on a shared Linux server.
bluedaniel
  • 2,079
  • 5
  • 31
  • 49
47
votes
5 answers

Best way for interprocess communication in C++

I have two processes one will query other for data.There will be huge amount of queries in a limited time (10000 per second) and data (>100 mb) will be transferred per second.Type of data will be an integral type(double,int) My question is in which…
Qubeuc
  • 982
  • 1
  • 11
  • 22
45
votes
5 answers

How to list processes attached to a shared memory segment in linux?

How do I determine what process is attached to a shared memory segment? awagner@tree:/home/awagner$ ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x00000000 0 …
Andrew Wagner
  • 22,677
  • 21
  • 86
  • 100
44
votes
4 answers

How to access Google Spreadsheets with a service account credentials?

I have created a server side application in PHP that's supposed to work with Google Spreadsheets. I'm able to authenticate successfully with OAuth 2.0 authentication, but when requesting the list of the spreadsheets from Google, I only get the…
ZurabWeb
  • 1,241
  • 1
  • 12
  • 21
43
votes
7 answers

How to create a Shared Login Service across Multiple Domains?

I'm interested in how to implement a shared cross-domain login system as well as best practices and security precautions to take. If you are familiar with 37Signals, you are probably accustomed to their usage of having a shared universal…
Corey Ballou
  • 42,389
  • 8
  • 62
  • 75
39
votes
2 answers

Shared library in containers

For two processes A and B, the both use the library libc.so, libc.so is loaded into memory only once. This is a normal situation when A and B both run on the same host and the same rootfs. When it comes to container, if A and B are running in…
Xinli Niu
  • 471
  • 1
  • 4
  • 6
36
votes
4 answers

How to share semaphores between processes using shared memory

I have to synchronize N client processes with one server. These processes are forked by a main function in which I declared 3 semaphores. I decided to use POSIX semaphores but I don't know how to share them between these processes. I thought that…
Sicioldr
  • 543
  • 3
  • 7
  • 13
35
votes
7 answers

Sharing a variable between multiple different threads

I want to share a variable between multiple threads like this: boolean flag = true; T1 main = new T1(); T2 help = new T2(); main.start(); help.start(); I'd like to share flag between main and help thread where these are two different Java classes…
user1031431
  • 1,475
  • 6
  • 17
  • 24
1
2 3
93 94