[Mono-bugs] [Bug 41841][Maj] Changed - Static Collections require ThreadSafety
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Sat, 3 May 2003 17:55:08 -0400 (EDT)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by r.h.lee@attbi.com.
http://bugzilla.ximian.com/show_bug.cgi?id=41841
--- shadow/41841 Wed Apr 30 10:37:06 2003
+++ shadow/41841.tmp.29308 Sat May 3 17:55:08 2003
@@ -92,6 +92,29 @@
------- Additional Comments From r.h.lee@attbi.com 2003-04-30 10:37 -------
[Wed Apr 30 07:32:44] Cvs has bug #41841
This bug is resilient.
The environment (design) may need to be changed.
+
+------- Additional Comments From r.h.lee@attbi.com 2003-05-03 17:55 -------
+
+For now, the best approach is for the MultiThreaded .NET Developer to
+lock access to static functions that manipulate/provide data, even if
+the spec states it is thread-safe.
+
+private void _thandler() {
+ string fmt="A, B, C";
+
+ Console.WriteLine (Thread.CurrentThread.Name + "waiting.");
+ while (!_go) {}
+ for (int i=0; i<1000; ++i) {
+ lock (_locksem) { //lock access
+ Enum.Parse (typeof(Test), fmt);
+ }
+ }
+ Console.WriteLine (Thread.CurrentThread.Name + "done.");
+}
+
+A long term solution may be to modify underlying ves to provides a
+thread-safe environment for CLR design.
+