B
buu
So, I have an app. (vb.net 2005) that is a multithreading app. and this
application is blocking after some time.
I have a 1-20 threads doing some jobs and after some time (not at the same
place every time and not always), threads are just stopping at some place
(all of them on the same place).
There is an object that are using all threads (not the same object, but same
type of), and these threads are blocking on following part of code:
<MethodImpl(MethodImplOptions.Synchronized)> _
Public Function FullLocalName(ByRef vSites As cSites) As String
If Not vSites Is Nothing And _SiteId > 0 Then
If _refId = 0 Then
Return vSites.Site(_SiteId).SiteHeader.FolderName &
"photos\" & _Id.ToString & ".jpg"
Else
Return vSites.Site(_SiteId).SiteHeader.FolderName & "photos"
& _refId.ToString & ".jpg"
End If
Else
Return vbNullString
End If
End Function
this function is being called at the place where threads are blocking...
but, to emphasize, they are not blocking on this part at a first pass, but
after 2-3 hours of working and passing through it for many many times.
Altough, there are no needs for putting Synchronized before a function, I
putted there because I though that it needs it.
also, all variables with prefix "_" are local/private variables (also used
in other properties/subs/functions of that object).
does anybody have some anwser for that?
I'm becoming a desperate since I'm trying to fix it 2 weeks
application is blocking after some time.
I have a 1-20 threads doing some jobs and after some time (not at the same
place every time and not always), threads are just stopping at some place
(all of them on the same place).
There is an object that are using all threads (not the same object, but same
type of), and these threads are blocking on following part of code:
<MethodImpl(MethodImplOptions.Synchronized)> _
Public Function FullLocalName(ByRef vSites As cSites) As String
If Not vSites Is Nothing And _SiteId > 0 Then
If _refId = 0 Then
Return vSites.Site(_SiteId).SiteHeader.FolderName &
"photos\" & _Id.ToString & ".jpg"
Else
Return vSites.Site(_SiteId).SiteHeader.FolderName & "photos"
& _refId.ToString & ".jpg"
End If
Else
Return vbNullString
End If
End Function
this function is being called at the place where threads are blocking...
but, to emphasize, they are not blocking on this part at a first pass, but
after 2-3 hours of working and passing through it for many many times.
Altough, there are no needs for putting Synchronized before a function, I
putted there because I though that it needs it.
also, all variables with prefix "_" are local/private variables (also used
in other properties/subs/functions of that object).
does anybody have some anwser for that?
I'm becoming a desperate since I'm trying to fix it 2 weeks