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
4
votes
3 answers

android shared preferences example for high scores?

Hi I was wondering is there any simple example of implementing a high score list using shared preferences? ie have pre determined high scores at the start and then update the list dependingt on the score a user gets?
user560571
  • 1,977
  • 3
  • 17
  • 17
4
votes
2 answers

Does an Android library project also export its external libraries?

I'm developing a software layer that I would like to reuse several time for building my Android applications. Basically I want that, once installed, the software layer any other apps can use it (like a system library). I was wondering what is the…
4
votes
1 answer

Xamarin.Forms app need to write to a shared local storage location

I am in the process of writing a Xamarin.Forms line-of-business application. The app will be targeting UWP and Android. I have a requirement of being able to store information and pictures taken, in a shared folder on the local storage. This way,…
Eric
  • 139
  • 2
  • 11
4
votes
1 answer

Why would OpenCL shader ignore Green, Blue, and Alpha channel when writing to OpenGL Texture?

I have a opencl shader that attempts to write a color to a texture, but for some reason, only the red channel is applied to the texture, the rest are ignored. Not only that, but this red channel value gets copied to all the other channels, giving…
Rafael Sabino
  • 165
  • 1
  • 8
4
votes
1 answer

C++ differ between Linking with .o and with .a file: different behavior, why?

I expected that: linking with .o file, and linking with .a file archived from the .o file, should have no difference. But the fact is not. I have got 2 source files, each declaring 1class+1 static object+1 function, and a main.cpp that called one…
Troskyvs
  • 7,537
  • 7
  • 47
  • 115
4
votes
1 answer

WPF MenuItem Icon sharing

I want to bind icons to the MenuItem controls where these items are dynamically created. I tried to set the x:Shared attribute to False but always only the last item has icon. Here is my style for the MenuItems ItemContainerStyle…
Panthesilea
  • 123
  • 9
4
votes
1 answer

PHP: threaded agents sharing a common object

I'm running a CGI program in non-threaded PHP, a little exercise in artificial life and evolution. Organisms have a genome and an interpreter, which causes them to perform certain operations, including moving about and interacting with one another…
Gralgrathor
  • 216
  • 1
  • 8
4
votes
1 answer

If I spawn another process using exec, can it access shared memory mapped using mmap?

If I fork and exec another executable, will the newly spawned process be able to access memory shared through mmap from the parent. ... fd = open(filename) str = mmap (MAP_SHARED, .. fd) pid = fork(); if(pid == 0) { …
4
votes
4 answers

Suggest for working together with a shared project

i am working in an app for my self, nothing big,nothing for customer.i am working with 2 friends and we d like to know the best way to share the project in order to work in the meantime. We are using dropbox,but we are not sure is the best way…
Alessandro Bovo
  • 345
  • 2
  • 15
4
votes
2 answers

C++ - Access Global Variables Objects

I'm building a C++ project and I would like to create a global custom object. I have created a custom class called Material. rt.h template class Material { public: Vec3 ka, kd, ks, kr; T sp, transparency, reflectivity; …
Marcus
  • 9,032
  • 11
  • 45
  • 84
4
votes
2 answers

VB .NET Shared Function if called multiple times simultaneously

Consider I have a shared function:- Public Shared Function CalculateAreaFromRadius(ByVal radius As Double) As Double ' square the radius... Dim radiusSquared As Double radiusSquared = radius * radius ' multiply it by pi... Dim…
Mehdi Anis
  • 358
  • 1
  • 9
  • 17
4
votes
1 answer

Linking with a shared library without version

A few months ago, I built a C software that used libxml2 as a shared library, on a debian. I created a .deb file for installation of the software, and Ubuntu users could make it run. Today, the latest version of Ubuntu has a greater version of…
Vincent
  • 165
  • 10
4
votes
2 answers

Accessing a Resource Calendar with no mailbox via EWS and C#

Our Exchange Admins (Exchange 2010 SP1) have setup a shared resource calendar. There is no mailbox assigned to this resource calendar. I want to be able to read the meetings using EWS and C#. Snippet: ExchangeService esvc = new…
user2308563
  • 41
  • 1
  • 2
4
votes
2 answers

Sharing variables across multiple mod_wsgi processes/threads

Can you have an object shared across multiple WSGI threads/processes (and in a manner that would work on both *NIX and Windows)? The basic premise: (1) I have a WSGI front end that will connect to a back end server. I have a serialization class,…
4
votes
1 answer

Shared list, multiple conditions, one or more condition variables?

Consider that you have a list: class CLIENTS { public: CLIENTS(); ~CLIENTS(); bool addClient(); bool removeClient(); bool getDataFromClientObj(unsigned int id); bool storeDataInClientObj(unsigned int id); private: //…
fludd
  • 53
  • 1
  • 6