asp.net - Thread Safety on my method -


Whether this code is considered to be a thread, even if many threads are used by voting the directory for files on the webserver at one time. Are you?

Thanks, Mike

  // Get a testimonial virtual root = hosting environment. Application virtual path; Configuration = Web Configuration Manager OpenWeb Configuration (Virtual Array); PathToNewsDirectory = configuration.AppSettings.Settings ["VanHinoWeb.news.dir"]. Values; FileListing = Directory.GetFiles (Pathtoence Directory, "* xml"); Int index = generator.Next (0, fileListing.Length); // Keep it in XML and get data to return to the certificate; Reader = new XML text reader (file listing [index]); TestimonialReader.ReadToFollowing ("bid"); Testimonials Data [0] = testimonialReader.ReadString (); TestimonialReader.ReadToFollowing ("Author"); Testimonials Data [1] = testimonialReader.ReadString (); TestimonialReader.ReadToFollowing ("authorTitle"); TestimonialsData [2] = testimonialReader.ReadString (); Return testimonials data; } Most of the calls under  

get a testimonial The comment thread should be safe.

However, it is not clear whether generator object, testimonialrereader , and testimonial data are created and whether they Threads are shared or not. If they are shared in threads, the code thread is not secure.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -