Skip to contentSkip to conversation

Doubt in Kernel Timers

DISCUSSION sekhar raja 3 participants 5 messages Nov 26, 2001 – Nov 27, 2001

lore
Share & tools
lore
#0 lore raw

Hi Folks

I have a doubt in Kernel Timers, Can we delete the Timer with out adding it to the timer List.

What do i mean is with out Doing add_timer() can we use del_timer().

If we can not do that, how do we check whether the particular timer is running or not.

Your help will be greatly Appreciated, Please CC me the Answer as i am not Subscribe to the mailing list.

Thanks in Advance
-Rajasekhar

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

#1 lore raw
Quoted 9 lines · sekhar raja

Hi Folks

I have a doubt in Kernel Timers, Can we delete the Timer with out adding it to the timer List.

What do i mean is with out Doing add_timer() can we use del_timer().

Quoted 9 lines

If we can not do that, how do we check whether the particular timer is running or not.

Your help will be greatly Appreciated, Please CC me the Answer as i am not Subscribe to the mailing list.

Thanks in Advance
-Rajasekhar

A quick glance at the source would assure you that YES you can del_timer() at any time. Looking at this code you would discover that the list linkage being NULL indicates that the timer is not active.

Read the SOURCE.

Signature · 3 lines
George           [email protected]
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Real time sched: http://sourceforge.net/projects/rtsched/
#2 lore raw
In reply to sekhar raja
Quoted 2 lines · On Mon, 26 Nov 2001 04:55:17 -0800 (PST) sekhar raja <[email protected]>…

What do i mean is with out Doing add_timer() can we use del_timer().

george anzinger is right, you may del_timer() at any time. If the timer was actually queued, del_timer() returns 0, otherwise, it returns 1.

But you should use del_timer_sync() to be sure, that your timer function is not currentky running on other CPU.

Quoted 2 lines

Thanks in Advance
-Rajasekhar

---
WBR. //s0mbre

#3 lore raw

Do we need to Stop the timers if we want to Restart the timers with new expiry time.

I see in some implementations the timers are not
stoped before before they restart. Is it correct?

Thanks in Advance
-Rajasekhar

Quoted 18 lines · --- Evgeniy Polyakov
Quoted 1 line · On Mon, 26 Nov 2001 04:55:17 -0800 (PST) sekhar raja <[email protected]>…

What do i mean is with out Doing add_timer() can

we

Quoted 1 line

use del_timer().

george anzinger is right, you may del_timer() at any time.
If the timer was actually queued, del_timer() returns 0, otherwise, it
returns 1.

But you should use del_timer_sync() to be sure, that your timer function
is not currentky running on other CPU.

Quoted 4 lines
Quoted 2 lines

Thanks in Advance
-Rajasekhar

---
WBR. //s0mbre

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

#4 lore raw
Quoted 2 lines · On Mon, 26 Nov 2001 23:08:45 -0800 (PST) sekhar raja <[email protected]>…

Do we need to Stop the timers if we want to Restart the timers with new expiry time.

You must simply use mod_timer() to change timer expires time.

Quoted 2 lines

I see in some implementations the timers are not
stoped before before they restart. Is it correct?

T.e. they are *not* use del_timer() and after it add_timer() with new expires time?
With del and add some races can arise.
It is correct to use mod_timer().

Quoted 4 lines

Thanks in Advance
-Rajasekhar

---
WBR. //s0mbre