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
-2
votes
1 answer

reading from and writing to a shared array in c++

I want to have two different classes accessing to a shared array with mutex protected. One class writing into the array and the other reading from the array if there is an element in the array. What are the possible ways of such implementation in…
Avb Avb
  • 545
  • 2
  • 13
  • 25
-3
votes
2 answers

Shared instance of App -iPhone

How to create shared instance of my app? "appDel is an AppDelegate shared instance of your application"
user622203
  • 149
  • 6
  • 20
-3
votes
1 answer

Shared Ip Hosting

i am a newbie in the field so i need sm1 to enlight me with authentic knowledge.thanks in advance. for example ns1.bh-17.webhostbox.net this above nameserver shows various domains that make use of it to resolve to correct host. so my question is…
user2230604
  • 31
  • 1
  • 1
  • 3
-3
votes
5 answers

what is shared variable in java

is there any concept of shared variable in java and if it is what is it?
Vipul
  • 2,637
  • 6
  • 25
  • 28
-4
votes
1 answer

Process memory examination

I have a process that listens on a socket for incoming connections. When a connection arrives, a thread is created, the thread reads a request from the socket and sends back a reply. Here is the code of the process: int main(int argc, char…
ErectCrested
  • 56
  • 1
  • 10
-4
votes
1 answer

the program crashes as soon i execute

this program is supposed to write to shared memory using win32 API. it is a program given as it is in text book but when i try to execute it it fails. it crashes as i click on execute the program is supposed to write a string to shared…
-5
votes
2 answers

CUDA: Using a global thread index with shared memory won't work

Can someone explain why my kernel doesn't work when my shared memory array of pointers, TMS, is accessed at some index other than the 0th index (happens in the last line)? If TMS[0] is used in the last line, everything works as expected. When I…
Jordan
  • 305
  • 3
  • 13
-5
votes
3 answers

How to save your high-score

I want to save my best, only one high-score to file, and then if game is on to show it on menu screen. Like this: Best: Points. I have my points and they count until you die, but then I don't know how to save them. I heard about Share…
user2088880
  • 39
  • 2
  • 8
-7
votes
1 answer

Using make_shared with char[] or int[]

Can you tell me if this works in VS2015 ? shared_ptr< char> buffer( make_shared< array< char,10>>() , [] (char *p){delete[] p; } ); or shared_ptr< char> buffer( make_shared< array< int,10>>() ,default_delete< int[]>());
1 2 3
93
94