By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,561 Members | 1,231 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,561 IT Pros & Developers. It's quick & easy.

Semaphores

P: n/a
Hi, I'm doing an IT degree at university, and my lecturer's do not teach
m$ technologies. I was wondering if anyone could point me to the
implementation of mutex's and semaphores in .net? Or the microsoft
equivalent of them.
Apr 9 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Try reading Jon Skeet's article on multithreading in .NET:

http://www.yoda.arachsys.com/csharp/threads/

Apr 9 '06 #2

P: n/a
Steven,
If you want to see the actual code for the implementation of Mutex,
Semaphore, etc. , download yourself a copy of Lutz Roeder's free Reflector
product, Load MsCorlib, and use the built - in disassembler to see the actual
code in your favorite language.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Steven Spencer" wrote:
Hi, I'm doing an IT degree at university, and my lecturer's do not teach
m$ technologies. I was wondering if anyone could point me to the
implementation of mutex's and semaphores in .net? Or the microsoft
equivalent of them.

Apr 9 '06 #3

P: n/a
I'm afraid this will not work for him, since they are implemented in .NET
framework by calling WinAPI.
And Semaphore class is in System.dll, not in mscorlib.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:72**********************************@microsof t.com...
Steven,
If you want to see the actual code for the implementation of Mutex,
Semaphore, etc. , download yourself a copy of Lutz Roeder's free Reflector
product, Load MsCorlib, and use the built - in disassembler to see the
actual
code in your favorite language.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Steven Spencer" wrote:
Hi, I'm doing an IT degree at university, and my lecturer's do not teach
m$ technologies. I was wondering if anyone could point me to the
implementation of mutex's and semaphores in .net? Or the microsoft
equivalent of them.

Apr 9 '06 #4

P: n/a
Yes, Semaphore is in System.Dll, and Mutex is in MsCorLib. And even though
WinAPI calls are used, you can still decompile to C# for example and examine
quite easily how everything is implemented, including any DLLImport
signatures.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Lebesgue" wrote:
I'm afraid this will not work for him, since they are implemented in .NET
framework by calling WinAPI.
And Semaphore class is in System.dll, not in mscorlib.

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> wrote in message
news:72**********************************@microsof t.com...
Steven,
If you want to see the actual code for the implementation of Mutex,
Semaphore, etc. , download yourself a copy of Lutz Roeder's free Reflector
product, Load MsCorlib, and use the built - in disassembler to see the
actual
code in your favorite language.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Steven Spencer" wrote:
Hi, I'm doing an IT degree at university, and my lecturer's do not teach
m$ technologies. I was wondering if anyone could point me to the
implementation of mutex's and semaphores in .net? Or the microsoft
equivalent of them.


Apr 9 '06 #5

P: n/a
Here is one I did before 2.0 was out:
http://www.codeproject.com/csharp/Di...sp#xx1205311xx

--
William Stacey [MVP]

"Steven Spencer" <Sp****@spinalogic.ws> wrote in message
news:44********@dnews.tpgi.com.au...
| Hi, I'm doing an IT degree at university, and my lecturer's do not teach
| m$ technologies. I was wondering if anyone could point me to the
| implementation of mutex's and semaphores in .net? Or the microsoft
| equivalent of them.
Apr 10 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.