私は共有機能を持っていると考えてください:-
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 result As Double
result = radiusSquared * Math.PI
'Wait a bit, for the sake of testing and
'simulate another call will be made b4 earlier one ended or such
for i as Integer = 0 to integer.Max
Next
' return the result...
Return result
End Function
私の質問:
同じ vb .net アプリに 2 つ以上のスレッドがあり、それぞれが異なる RADIUS で同時に共有関数を呼び出す場合、それぞれ独自の AREA を取得しますか?
関数の呼び出しごとに同じローカル変数を使用しているかどうか、または呼び出しごとにローカル変数の新しいインスタンスが作成されているかどうかを知りたいですか?
複数 (2 つ以上) のシングル スレッド アプリがあり、それらすべてが異なる RADIUS 値で同時に関数を呼び出す場合、上記の質問に対する回答は同じになりますか?
私はあなたの応答に感謝します。ありがとうございました。