Groups | Blog | Home
all groups > dotnet sdk > october 2004 >

dotnet sdk : Newbie question.


Richard Blewett [DevelopMentor]
10/29/2004 6:15:16 AM
System.Threading.AutoResetEvent and System.Threading.ManualResetEvent

and

WaitHandle.WaitOne

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

Hello,
I just started learning .NET programming under C#.

In C++ I use Event objects and WaitForMultipleObjects for Thread
synchronization.

What is the equivalent og Event objects under .NET/C#?
--
Regards,
Sami

Nicholas Paldino [.NET/C# MVP]
10/29/2004 8:40:25 AM
Sami,

In .NET, for those kind of notification events, you would use the Event
class. Once you have an instance of the Event class, you can wait for that
by calling the WaitOne method on the event.

If you want to wait on multiple objects, then you can call the static
WaitAll or WaitAny methods on the WaitHandle class. However, you can not
call WaitAll on a thread that is a single threaded apartment (any UI thread
basically).

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

[quoted text, click to view]

Jason Haley, MCSD.Net
10/29/2004 8:48:06 AM
If you are really looking to get into .Net, I suggest you purchase Juval
Lowy's book on Programming .Net Components. Chapter 6 - Events, Chapter - 7
Asynchronous Calls and Chapter - 8 Multithreading and Concurrency Management,
Sami
10/29/2004 2:21:22 PM
Hello,
I just started learning .NET programming under C#.

In C++ I use Event objects and WaitForMultipleObjects for Thread
synchronization.

What is the equivalent og Event objects under .NET/C#?
--
Regards,
Sami

[Remove Numbers from e-mail address to use it]

Sami
11/1/2004 11:06:35 AM
Thanks for all your help.

--
Regards,
Sami

[Remove Numbers from e-mail address to use it]
"Sami" <s8a2m9i1_i5s1l9a6m@hotmail.com> schrieb im Newsbeitrag
news:O4BajGbvEHA.3360@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button