|
-
April 7th, 2010, 05:05 PM
#1
how many instance will a shared variable be created? just 1 correct?
Hi :
How many instances of a shared variable will be created in a class? just one? correct
Code:
Public Class DocumentDelivery
Implements IDisposable
'A rendered list that contains the rendered documents
Public Shared RenderList As List(Of Byte()())
End Class
So, in other words, the DocumentDelivery class will only have one instance of RenderList, correct? can somebody confirm?
-
April 7th, 2010, 05:54 PM
#2
Re: how many instance will a shared variable be created? just 1 correct?
correct. And all instances of DocumentDelivery (if any) would share it, as any piece of code that can access it through DocumentDelivery (class itself).
Beware of multithreading on a multiprocessor machine, though: it might ruin your day...
Last edited by Cimperiali; April 7th, 2010 at 05:57 PM.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
April 7th, 2010, 09:12 PM
#3
Re: how many instance will a shared variable be created? just 1 correct?
why? if I never intend for this to run in a multi threaded environment...
-
April 8th, 2010, 02:02 AM
#4
Re: how many instance will a shared variable be created? just 1 correct?
then you should have no matters.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|