Click here to Skip to main content
16,005,141 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: deploying applications in client machines Pin
Dave Kreskowiak11-Nov-08 3:23
mveDave Kreskowiak11-Nov-08 3:23 
GeneralRe: deploying applications in client machines [modified] Pin
pravimarrs11-Nov-08 18:53
pravimarrs11-Nov-08 18:53 
GeneralRe: deploying applications in client machines Pin
Anoop Brijmohun11-Nov-08 19:27
Anoop Brijmohun11-Nov-08 19:27 
GeneralRe: deploying applications in client machines Pin
pravimarrs11-Nov-08 21:25
pravimarrs11-Nov-08 21:25 
GeneralRe: deploying applications in client machines Pin
Anoop Brijmohun12-Nov-08 2:31
Anoop Brijmohun12-Nov-08 2:31 
QuestionHow to pass discrete parameters to stored procedure from crystal report Pin
thiru_586210-Nov-08 18:03
thiru_586210-Nov-08 18:03 
Questionarraylist issue Pin
Tauseef A10-Nov-08 17:54
Tauseef A10-Nov-08 17:54 
AnswerRe: arraylist issue Pin
Guffa10-Nov-08 21:02
Guffa10-Nov-08 21:02 
Unless you are stuck with framework 1, don't use the ArrayList class at all.

You should not use the reference of the actual data in the SyncLock statement, you should create a private Object that is only used for synchronising. That way there is no risk of a deadlock because you are exposing the data as a public member, and code outside of your class is also using the data object for locking.

The ArrayList class provides an object for synchronisation as the SyncRoot property, but for a generic list you have to create an object yourself.

Example:
Public Class SynchronisedList(Of T)

   Private _list As List(Of T)
   Private _sync As Object

   Public Sub New()
      _list = New List(Of T)()
      _sync = New Object()
   End Sub

   Public Sub Add(value As T)
      SyncLock _sync
         _list.Add(value);
      End SyncLock
   End Sub

   Public ReadOnly Property Count As Integer
      Get
         SyncLock _sync
            Return _list.Count
         End SyncLock
      End Get
   End Property

   Public Function Get(index As Integer) As T
      SyncLock _sync
         Return _list(index)
      End SyncLock
   End Function

End Class


Despite everything, the person most likely to be fooling you next is yourself.

QuestionRe: arraylist issue Pin
Tauseef A10-Nov-08 23:56
Tauseef A10-Nov-08 23:56 
Questionneed help. Pin
faradgi10-Nov-08 9:47
faradgi10-Nov-08 9:47 
AnswerRe: need help. Pin
Thomas Stockwell10-Nov-08 9:49
professionalThomas Stockwell10-Nov-08 9:49 
Answer[Cross Post]Re: need help. Pin
Scott Dorman10-Nov-08 9:58
professionalScott Dorman10-Nov-08 9:58 
AnswerSTOP SPAMMING THE FORUMS Pin
leckey10-Nov-08 11:07
leckey10-Nov-08 11:07 
AnswerRe: need help. Pin
Paul Conrad10-Nov-08 12:27
professionalPaul Conrad10-Nov-08 12:27 
GeneralRe: need help. Pin
leckey10-Nov-08 14:50
leckey10-Nov-08 14:50 
GeneralRe: need help. Pin
Paul Conrad10-Nov-08 14:53
professionalPaul Conrad10-Nov-08 14:53 
JokeRe: need help. Pin
Guffa10-Nov-08 15:10
Guffa10-Nov-08 15:10 
GeneralRe: need help. Pin
leckey10-Nov-08 15:11
leckey10-Nov-08 15:11 
AnswerRe: need help. Pin
Christian Graus10-Nov-08 15:45
protectorChristian Graus10-Nov-08 15:45 
GeneralRe: need help. Pin
Paul Conrad10-Nov-08 17:42
professionalPaul Conrad10-Nov-08 17:42 
QuestionControl resize and positioning at run time. Pin
TechNyk10-Nov-08 9:25
TechNyk10-Nov-08 9:25 
AnswerRe: Control resize and positioning at run time. Pin
Kschuler10-Nov-08 9:58
Kschuler10-Nov-08 9:58 
QuestionVisual Studio Debug View (value column / hover pop up tooltip) custom content: DebuggerDisplay Pin
in9mar10-Nov-08 7:38
in9mar10-Nov-08 7:38 
AnswerRe: Visual Studio Debug View (value column / hover pop up tooltip) custom content Pin
Jon_Boy10-Nov-08 8:18
Jon_Boy10-Nov-08 8:18 
AnswerRe: Visual Studio Debug View (value column / hover pop up tooltip) custom content Pin
in9mar10-Nov-08 8:25
in9mar10-Nov-08 8:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.