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

store images locally vs cloudinary vs s3

The settings: Blog with posts, buily with Laravel, where: Every post can have max of 1 image (nullable). Max posts in the blog is 1000. Let's assume there are 1000 posts for the discussion. Every post has a comment section. Where registered users…
nscode
  • 147
  • 1
  • 9
5
votes
1 answer

Where is a VB.NET Static variable stored?

I want to know where a VB.NET local static variable is stored in the program's virtual address space, and how does a sub-routine/method retain its value between calls? I have searched extensively online in order to understand the VB.NET virtual…
Drummy
  • 203
  • 1
  • 5
5
votes
1 answer

how do you make a .so library with autoconf, rather that a .la library?

I want to make a shared library with autoconf. However, I want the shared library to have a ".so" extension and not to begin with "lib". Basically, I want to make a plug-in that will get loaded with dlopen. Is there an easy way to do this? When I…
vy32
  • 28,461
  • 37
  • 122
  • 246
5
votes
1 answer

Angular Reusable Modules and Components

What is the right/best way to share reusable code with Angular 2+? I'm currently using Angular 4, VSCode, TypeScript, npm, and Angular CLI. I'm a senior C# developer with some Angular 1.3 apps I want to upgrade. I'm working to get up to speed on…
5
votes
1 answer

Multi Threading Shared Local Variables

I am trying to fully understand how creating separate threads that call the same method of a class instance can effect local variables in the method. For example I have a class with a single method (Divide) public class Maths { public int Num1; …
selams
  • 105
  • 1
  • 3
5
votes
1 answer

Xamarin Forms masterdetail hide backbutton

I am working on Xamarin forms shared project with a master detail page. When I run the app the master detail page is the first item that loads yet it shows the back button which once clicked opens the navigation (master) drawer. This makes no…
user2029541
  • 666
  • 3
  • 12
  • 22
5
votes
1 answer

Initialize object in @Shared or setupSpec()

What's the difference between: @Shared MyObject myObject = new MyObject() and MyObject myObject def setupSpec() { myObject = new MyObjec() } Why should I use the @Shared annotation in the second example? Both are only created once, aren't…
GarfieldKlon
  • 11,170
  • 7
  • 31
  • 33
5
votes
1 answer

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

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.
dragan.stepanovic
  • 2,955
  • 8
  • 37
  • 66
5
votes
2 answers

When to use Shared methods in .NET

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…
Michael
  • 1,865
  • 3
  • 21
  • 23
5
votes
2 answers

Access a shared calendar (such as a meeting room via Office 365 REST API)

I'm using the Office 365 REST api to access my account's calendars. I'd like to access all the calendars my account has access to, in particular the meeting rooms calendars appearing in the "Other calendars" section in my Office 365 interface. For…
Nico
  • 1,580
  • 14
  • 21
5
votes
1 answer

Can't release textures created by a shared context

I met a problem using shared contexts: I have two threads and each has one context, say Thr1(thread1) with Ctx1(Context1) and Thr2 and Ctx2. Ctx2 was created sharing with Ctx1. Then, in Thr2, I create some textures with Ctx2 as current context, and…
CurtisGuo
  • 339
  • 1
  • 3
  • 10
5
votes
3 answers

Is NSUserDefaults thread safe for sharing data between extensions on IOS?

The documentation for App Extension under "Sharing Data with Your Containing App" uses NSUserDefaults to do so, and write a bit further that "to avoid data corruption, you must synchronize data accesses. Use Core Data, SQLite, or >Posix locks to…
user2962499
  • 486
  • 6
  • 10
5
votes
2 answers

using fork: accessing child process memory from parent

I'm using fork() in C to split up the work of running through local arrays, having each process run through half and then multiply the numbers at each point in the arrays and then set the product in a third array. pid_t pid; pid = fork(); if (pid…
Satchel76
  • 53
  • 1
  • 3
5
votes
4 answers

Does program need additional symbols from .so shared library except those declared in header file?

In C programming, I thought that a object file can be successfully linked with a .so file as long as the .so file offers all symbols which have been declared in the header file. Suppose I have foo.c, bar.h and two libraries libbar.so.1 and…
solotim
  • 1,826
  • 4
  • 24
  • 41
5
votes
2 answers

Shared memory or named pipes in ram?

I want to communicate between two different programs. A modded ambilight program which outputs led information and my own program that reads this information. I read about named pipes and shared memory. But for me it is not clear where the data is…
user3567603