Click to See Complete Forum and Search --> : Static functions and static variables


Vinod S
July 25th, 2006, 11:02 PM
Hi all i want to know whether the static functions and static variables are thread safe in asp .net.

I am creating a Datalayer for my asp .net application. i want to know whether i can make the functions in the datalayer static, and also the database objects static.

i know that the IIS is a multithreaded environment. so are the static functions will be thread safe.

Alsvha
July 26th, 2006, 12:33 AM
You can look up the methods/variables in the documentation to find out whether they are thread safe. Since we don't know which you think of, because you don't mention, it would be impossible to say:

http://msdn2.microsoft.com/en-us/library/ms306608.aspx

Vinod S
July 26th, 2006, 04:35 AM
I am talking about the database objects, Connection, command etc :)

wildfrog
July 26th, 2006, 04:52 AM
Hi all i want to know whether the static functions and static variables are thread safe in asp .net.
No, static doesn't mean that they are thread-safe. But, many of the static members of .Net Framework classes are thread-safe.

I am talking about the database objects, Connection, command etc Just look them up in the documenetation. Most of the classes (if not all) will tell you whether they're thread-safe or not.

- petter