In VB.NET, the Shared keyword is roughly equivalent to the static keyword used by many other languages.
In vb.net, the Shared
keyword is roughly equivalent to the static
keyword used by c# 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.