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
10
votes
2 answers

Are methods duplicated in memory for every instance of an object? If so, can this be avoided?

Say I have an object that exists in high quantity, stores little data about itself, but requires several larger functions to act upon itself. class Foo { public: bool is_dead(); private: float x, y, z; bool dead; void check_self(); …
Adrian
  • 2,276
  • 2
  • 19
  • 25
9
votes
1 answer

C++: dlclose doesn't unload the shared library

I have a shared library loaded using dlopen (with the flags RTLD_NOW | RTLD_GLOBAL ). If this library is using functions from the main program, then it does not unload. So I end up with the same code for this shared lib, even if I unloaded (using…
Ben
  • 165
  • 2
  • 5
9
votes
3 answers

Is there a way to tell openmp that shared data is constant?

I am guessing that even reading from shared data in openmp causes some parallel overheads, as depending on processor architecture (if different cores have their own cache...) it may be necessary to refresh the cache to ensure that no other cpu has…
Sideshow Bob
  • 4,566
  • 5
  • 42
  • 79
9
votes
2 answers

Multi Tenant Database with some Shared Data

I have a full multi-tenant database with TenantID's on all the tenanted databases. This all works well, except now we have a requirement to allow the tenanted databases to "link to" shared data. So, for example, the users can create their own "Bank"…
Sean Hederman
  • 460
  • 3
  • 13
9
votes
1 answer

Program to view Shared Memory in Windows?

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.
DMeier
  • 407
  • 1
  • 4
  • 8
9
votes
1 answer

Difference between iter() and into_iter() on a shared, borrowed Vec?

I am reading the Rust 101 tutorial, where the author talks about shared borrowing with the example of a Vec object passed to a function. Below is a slightly adapted MWE of what the the tutorial is teaching. The interesting part is v.iter() in…
mSSM
  • 598
  • 5
  • 12
9
votes
3 answers

User preferences file vs App preferences file

My android application has two kinds of preferences: 1) I have user preferences defined in res/xml/preferences.xml so that users can manage their preferences with a PreferenceActivity. 2) I'd like to define another file for global configuration…
user332563
9
votes
2 answers

Delay-Load equivalent in unix based systems

What is the delay load equivalent in unix based system. I have a code foo.cpp, While compiling with gcc I link it to shared objects(totally three .so files are there.). Each of the .so file for different option. ./foo -v needs libversion.so ./foo…
saran
  • 179
  • 2
  • 4
9
votes
3 answers

Shared readonly memory between Perl processes

I wish to make a Perl program of mine use multiple cores. It progressively reads query input and compares chunks of that against a read-only data-structure loaded from file into memory for each run. That data-structure, which is typically a few…
Niels Larsen
  • 119
  • 4
9
votes
1 answer

Can't nest TFS branches, so branching to share code doesn't work?

I've been following the advice in "Team Development with Visual Studio Team Foundation Server" on structuring projects and sharing code from one team project into another using branching. So our source tree looks like this: server\instance Shared …
Ian Goldby
  • 5,609
  • 1
  • 45
  • 81
8
votes
4 answers

How to use internal packages with go modules?

I am using go modules in my project. I have shared code in the internal folder. . ├── README.md ├── internal │   └── shared │   ├── request.go │   └── request_test.go └── web ├── README.md └── go └── src └──…
ssk
  • 9,045
  • 26
  • 96
  • 169
8
votes
7 answers

Can shared library call another shared library?

Can one shared library load and call functions from another shared library? I have Shared library libDsmTestLib.so that use another shared libraries libDsmShared.so and libPINDsmShared.so LOCAL_PATH := $(call my-dir) include…
Viktor Apoyan
  • 10,655
  • 22
  • 85
  • 147
8
votes
2 answers

Shared cache between Tomcat web apps

I'm looking for a solution to share a cache between two tomcat web apps running on different hosts. The cache is being used for data synchronization, so the cache must be guaranteed to be up-to-date at all times between the two tomcat instances. …
cambo
  • 973
  • 4
  • 11
  • 22
8
votes
2 answers

Git: repo for multiple users on a server

I created a Git repo on a server and want it to be used by several people, i.e. users which belong to the same Unix group. It also has a working copy because it may be useful for us to have a common working copy. Thus I set the owning group of that…
Albert
  • 65,406
  • 61
  • 242
  • 386
8
votes
4 answers

Write a private access file to another app's files directory

The two apps have the same sharedUserId. When I use this code in app1 context.openFileOutput("/data/data/org.me.app2/files/shared-data.dat", MODE_PRIVATE) I get an exception telling me that the file contains a path separator. I am trying to write a…
700 Software
  • 85,281
  • 83
  • 234
  • 341