1
Answer

Static members


Hi All Just want to know if the content in this article is correct,
http://www.c-sharpcorner.com/UploadFile/suthish_nair/3020/
I have given my comments to that article,If anyone can help pls.
Answers (1)
0
Bryian Tan

Bryian Tan

NA 9.4k 887.3k 14y

Hello,

Yes, you are correct, static objects are accessible across threads and shared among all instances of a class. In a multiuser environment, the same static variables are being used across all sessions. In the article the static variables are not thread safe, if the DataSet value is not user specific then there will be no problem. Otherwise there will be a concurrency risk when multiple users are using the application at the same time. The value set by the first user will be overwritten by the second user and so forth.         


Thanks,

Bryian Tan