Hi... I'm new to C#.
First off, I must say that I don't like the lock() statement. I dont' trust it. It just doesn't seem like something that would scale properly.... but I haven't verified that yet.. maybe its okay.
So I understand that you can call System.Threadin g.Monitor.Lock( ) for more advance locking, much like critical sections.... but I still don't understand why they can't just give us a CriticalSection object... at least then I'm not dealing with a global glass for all my locking needs.
So anyway, my REAL QUESTION is... I wanted to keep the lock() { stuff; } style syntax, but instead call my own choice of locking routines.
I had thought I could do that with snippets, but that proved to be futile... I don't want the snippet to expand.
In C++ I could accomplish that with a macro.... is there something I could do in C#?
Thanks
-J
First off, I must say that I don't like the lock() statement. I dont' trust it. It just doesn't seem like something that would scale properly.... but I haven't verified that yet.. maybe its okay.
So I understand that you can call System.Threadin g.Monitor.Lock( ) for more advance locking, much like critical sections.... but I still don't understand why they can't just give us a CriticalSection object... at least then I'm not dealing with a global glass for all my locking needs.
So anyway, my REAL QUESTION is... I wanted to keep the lock() { stuff; } style syntax, but instead call my own choice of locking routines.
I had thought I could do that with snippets, but that proved to be futile... I don't want the snippet to expand.
In C++ I could accomplish that with a macro.... is there something I could do in C#?
Thanks
-J
Comment