> > So this routine's > > code has for example: HttpContext.Current.User, which is request safe and > > thread safe by default. It then pulls a value from the service. This value > is > > stored in the thread's local stackframe, so every thread has a different > > instance of that value. It then returns that value, so it's perfectly > > threadsafe. > That's ok for LoadCurrentUser() body but how can we be sure the code it > calls is thread safe too? > I meant, proven that, for example, HttpContext.Current.User is thread > safe, what about GetSiteUserByUid()? We don't know anything about its > thread safety. > Couldn't it potentially be thread unsafe thus making the whole method > thread unsafe?
If calling a method is thread UNsafe, and it's documented the method is thread unsafe (e.g. list.IndexOf(o)), then yes, you have a point. Though the service is a singleton, or at least used as one. I then assume the methods in the singleton are able to act safely in a multi threaded environment. :) FB > > Thanks. > > -- > Efran Cobisi > http://www.cobisi.com > > =================================== > This list is hosted by DevelopMentorR http://www.develop.com > > View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com