Critical section in singleton
hello,
i have simple singleton class contains function in an asp.net web site
public membershipuser getmovieowner(guid movieid)
{
using (moviesdatacontext mdb = new moviesdatacontext())
{
guid userid = mdb.moviedatas.where(movie=>movie.movieid == movieid)
.select(movie=>movie.userid)
.single();
return membership.getuser(userid);
}
}
my question :
is code should in critical section ?
if user1 call function , , user2 call function ,
isn't possible user2 change movie id parameter of first user ?or 2 instances of function create in heap ?
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment