JumpsInLava Posted January 10, 2004 Posted January 10, 2004 I have an asp.net module that does stuff kind of like this: Module Stuff Dim strHold As String = String.Empty Public Sub subDoStuff(ByVal strString As String) 'Added SyncLock do to paranoia SyncLock GetType(Stuff) 'Clears strHold strHold = String.Empty 'Calls subProcess that does some stuff with strHold subProcess() 'Does some more stuff with strHold strHold &= strString 'Writes strHold somewhere End SyncLock End Sub Private Sub subProcess() 'Adds some stuff to strHold strHold = "This and that" End Sub End Module I saw some samples that used SyncLock, got paranoid, and added it to all of my modules that use any type of globals. (I know global variables are the root of all evil, and will cause nations to collapse, but they sure are handy some times.) Question 1: Do I need to use SyncLock? Question 2: If so, should I use "SyncLock GetType(strHold)" instead? Quote
JumpsInLava Posted January 12, 2004 Author Posted January 12, 2004 May be an better question would be: In ASP.NET, is each client session its own "application" on the server, or is each client session multi-threading from the same code on the server? Quote
Moderators Robby Posted January 12, 2004 Moderators Posted January 12, 2004 Yes "each client session its own "application" on the server" Quote Visit...Bassic Software
JumpsInLava Posted January 13, 2004 Author Posted January 13, 2004 Hmmmmm. Interesting. Thank you for the response. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.