473,474 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Timers and Alarms question

1 New Member
"Implement an Alarm class. Threads will call your Pause(int time) to go to sleep for a period of time. You can use the Java Timer class. When timer interrupt goes off, the Timer interrupt handler must wake up any thread sleeping in Pause whose interval has expired. It is not required that an awakened thread starts running immediately after the interval expires. Just have them wake up after they have waited for at least the specified interval, time"

How do I approach this? Please help me! It's very urgent.
Does it need to be synchronized? Why? How?
Nov 19 '07 #1
2 1099
r035198x
13,262 MVP
"Implement an Alarm class. Threads will call your Pause(int time) to go to sleep for a period of time. You can use the Java Timer class. When timer interrupt goes off, the Timer interrupt handler must wake up any thread sleeping in Pause whose interval has expired. It is not required that an awakened thread starts running immediately after the interval expires. Just have them wake up after they have waited for at least the specified interval, time"

How do I approach this? Please help me! It's very urgent.
Does it need to be synchronized? Why? How?
So you don't understand this question at all and don't know where to start. Go back to your teacher then and let them explain it to you.
Nov 19 '07 #2
JosAH
11,448 Recognized Expert MVP
I changed your topic title. "Need Urgent Help!!!" isn't a title that would attract readers.

kind regards,

Jos

ps. Read the API docs for the Timer class(es)
Nov 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: David Burstin | last post by:
Whenever I run VS.NET 2003, my CPU usage sits on 100%, with total memory usage at 330MB. The CPU stays at 100%, even before any projects are opened (on the start page) and for the rest of the...
1
by: Jason | last post by:
Hi all just a quick question. I have a windows service with a "Catalogue" class. I would like to know: if i put two "ServiceTimer" objects in my service 1. Do they run in separate threads...
3
by: Nathan Kovac | last post by:
I have a feeling I am missing something simple, but I just can't find it. Perhaps someone can give me a lead on where to look. I will describe the issue then post my code to the web service. My...
3
by: Jeff Greenland | last post by:
Hello everyone, I am having problems with Timers in a web application. They just seem to stop running after 15 minutes or so. My web application is set up like this: When a user hits a...
13
by: Bob | last post by:
My WinForms app runs on the single default thread, and uses a single SqlConnection object for all queries. I need to use one or more timers to periodically execute some of them. My own testing...
3
by: Maarten | last post by:
Hi In my aplication it seems that my timer slows down everything, is there a better and/or diferent way than using a timer Maarten
1
by: melanieab | last post by:
Hi, I'm have a datagrid, and I'm trying to have a tooltip pop up if a cell has been hovered on for 2 seconds. I was thinking of using DataGrid.Hover, but then decided to try this instead: ...
2
by: Kiran | last post by:
I am creating 2 timers inside a GUI, but it seems that only the one declared last (the second timer), gets triggered, but the first one doesnt. Here is the code for the timers: # main timer,...
7
by: RobKinney1 | last post by:
Hello, Wow...I have one for you all and hopefully I am not understanding this timer object correctly. I have a timer setup that pulses a connection through a socket every 60 seconds. But it...
5
by: Tony Gravagno | last post by:
I have a class that instantiates two Timer objects that fire at different intervals. My class can be instantiated within a Windows Form or from a Windows Service. Actions performed by one of the...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.