473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Monitor.Wait vs Thread.Sleep

DT
Hi All,

I understand the Thread.Sleep method is a very effcient wait state.
Can the same be said for the Monitor.Wait method?

Many Thanks

DT
Jul 21 '05 #1
2 2872
They're used for two different things. In Win32 most blocking waits are
efficient as long as you're letting the OS do the waiting, and the .NET
wrappers are no exception.
--
Klaus H. Probst, MVP
http://www.vbbox.com/
"DT" <dt@nospam.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Hi All,

I understand the Thread.Sleep method is a very effcient wait state. Can the same be said for the Monitor.Wait method?

Many Thanks

DT

Jul 21 '05 #2
DT
Thanks for the reply Klaus, I know they're different, I'm using the
Monitor.Wait method to wait for a period of time or when I want to signal
it. I just wanted to know there was any problems in doing this.

thanks

"DT" <dt@nospam.co.uk> wrote in message
news:41*********************@mercury.nildram.net.. .
Hi All,

I understand the Thread.Sleep method is a very effcient wait state.
Can the same be said for the Monitor.Wait method?

Many Thanks

DT

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Vinay C | last post by:
Hi, Can anyone clear me that, when should we use go for mutex, and in which situation should we opt for monitor, lock, semaphone and other objects, in a multithreaded application for synchronization...
5
by: bughunter | last post by:
Hi, Consider this code: ---- Monitor.Pulse(oLock); Monitor.Exit(oLock); ---- If a thread was waiting on oLock then will the current thread
11
by: Michi Henning | last post by:
Hi, I'm calling Monitor.Wait() from a console event handler. It's not working -- the call to Wait() immediately causes the process to exit. Is it impossible for some reason to call Wait() from...
25
by: vooose | last post by:
Suppose execution of a particular thread T1 hits Monitor.Enter(obj); //critical section and blocks at the first line. (ie someone else is in the critical section) Now suppose more threads...
4
by: DT | last post by:
Hi All, I understand the Thread.Sleep method is a very effcient wait state. Can the same be said for the Monitor.Wait method? Many Thanks DT
0
by: Chris Chilvers | last post by:
I've found the docs to be rather scant on exactly what the second parameter to WaitHandle.WaitOne(Int32, Boolean) was for. The one named exitContext so I started playing with the synchronize...
12
by: Perecli Manole | last post by:
I am having some strange thread synchronization problems that require me to better understand the intricacies of Monitor.Wait/Pulse. I have 3 threads. Thread 1 does a Monitor.Wait in a SyncLock...
2
by: DeveloperX | last post by:
Hi, Below is a hacked up version of an example I found on MSDN. My only change was to add a third thread and some Sleeps. That's where my question(s) comes in. In the original it seems to work...
13
by: AliRezaGoogle | last post by:
Dear Members, I have a problem in the concepts of Monit.Enter and Monitor.Exit (Before everything I should say that I know how to solve this problem by using Monitor.Wait and I do not need a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.