Click here to Skip to main content
15,910,661 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Rounding problem w/ var of type single Pin
Dave Kreskowiak9-Apr-09 7:46
mveDave Kreskowiak9-Apr-09 7:46 
GeneralRe: Rounding problem w/ var of type single Pin
Jon_Boy9-Apr-09 7:59
Jon_Boy9-Apr-09 7:59 
GeneralRe: Rounding problem w/ var of type single Pin
Dalek Dave9-Apr-09 9:01
professionalDalek Dave9-Apr-09 9:01 
QuestionHow can I add a column using VB? Pin
enipla9-Apr-09 5:28
enipla9-Apr-09 5:28 
AnswerRe: How can I add a column using VB? Pin
Jon_Boy9-Apr-09 6:32
Jon_Boy9-Apr-09 6:32 
GeneralRe: How can I add a column using VB? Pin
enipla9-Apr-09 7:40
enipla9-Apr-09 7:40 
GeneralRe: How can I add a column using VB? Pin
enipla9-Apr-09 8:12
enipla9-Apr-09 8:12 
QuestionSyncLocking [modified] Pin
captainmogo9-Apr-09 4:45
captainmogo9-Apr-09 4:45 
I have 2 collection objects in a LogRequest class. One is a dictionary(string, myStruct) and the other is a list(of String). In a continuous thread, I am updating the myStruct data in m_dict and possibly adding items to m_List, depending on what type of data it is.

I also have a tcp listener that accepts client requests for this data. I make the data available through 2 different properties; Data, which gets the m_dict data and StateData, which gets the list data.

Currently I am using the SyncLock in the thread during the update and when the data is retrieved for the m_dict but I am not sure what to do with locking the list. Do I use a separate lock obj or is it already locked bc it was locked at the beginning of the update? Would using the same lock obj in both retrieving routines cause a deadlock?

Public Class LogRequest

While loop

SyncLock lock_obj
For i = 0 to x (however many myStructs need to be updated in m_dict)
Dim data as myStruct= m_dict.Item(name)
data.Value = 'new value'
data.Time = 'new time'

if data.IsState then
m_List.Add("")
End if

m_dict(name) = date
Next

End While


Public ReadOnly Property Data() as string
Get SyncLock lock_obj
For each kvp as KeyValuePair(of String, myStruct) in m_dict
...builds output string
Next
Return string to client
End get
End Property


Public ReadOnly Property StateData() as string
Get
SyncLock ?? 'I dont know what to lock here
For each s as string in m_List
....builds output string
Next
Return string ot client
End SyncLock
End Get
End Property

modified on Thursday, April 9, 2009 11:00 AM

AnswerRe: SyncLocking Pin
Dave Kreskowiak9-Apr-09 8:08
mveDave Kreskowiak9-Apr-09 8:08 
GeneralRe: SyncLocking Pin
captainmogo9-Apr-09 8:14
captainmogo9-Apr-09 8:14 
GeneralRe: SyncLocking Pin
Dave Kreskowiak9-Apr-09 8:18
mveDave Kreskowiak9-Apr-09 8:18 
GeneralRe: SyncLocking [modified] Pin
captainmogo9-Apr-09 8:30
captainmogo9-Apr-09 8:30 
QuestionClickonce and command line args? Pin
Jon_Boy9-Apr-09 3:44
Jon_Boy9-Apr-09 3:44 
AnswerRe: Clickonce and command line args? Pin
Dave Kreskowiak9-Apr-09 4:04
mveDave Kreskowiak9-Apr-09 4:04 
GeneralRe: Clickonce and command line args? Pin
Jon_Boy9-Apr-09 4:33
Jon_Boy9-Apr-09 4:33 
GeneralRe: Clickonce and command line args? Pin
Dave Kreskowiak9-Apr-09 4:43
mveDave Kreskowiak9-Apr-09 4:43 
GeneralRe: Clickonce and command line args? Pin
Jon_Boy9-Apr-09 4:58
Jon_Boy9-Apr-09 4:58 
GeneralRe: Clickonce and command line args? Pin
Eddy Vluggen9-Apr-09 8:30
professionalEddy Vluggen9-Apr-09 8:30 
GeneralRe: Clickonce and command line args? Pin
Jon_Boy9-Apr-09 9:01
Jon_Boy9-Apr-09 9:01 
QuestionRe: Clickonce and command line args? Pin
Eddy Vluggen9-Apr-09 9:28
professionalEddy Vluggen9-Apr-09 9:28 
AnswerRe: Clickonce and command line args? Pin
Jon_Boy9-Apr-09 9:49
Jon_Boy9-Apr-09 9:49 
GeneralRe: Clickonce and command line args? Pin
Eddy Vluggen9-Apr-09 10:21
professionalEddy Vluggen9-Apr-09 10:21 
QuestionDetermine what type of object a GUID belongs to. Pin
Jay Royall9-Apr-09 2:09
Jay Royall9-Apr-09 2:09 
AnswerRe: Determine what type of object a GUID belongs to. Pin
Dave Kreskowiak9-Apr-09 3:43
mveDave Kreskowiak9-Apr-09 3:43 
GeneralRe: Determine what type of object a GUID belongs to. Pin
Jay Royall9-Apr-09 4:06
Jay Royall9-Apr-09 4:06 

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.