public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Doubt in Kernel Timers
@ 2001-11-26 12:55 sekhar raja
  2001-11-26 17:58 ` george anzinger
  2001-11-27  5:36 ` Evgeniy Polyakov
  0 siblings, 2 replies; 5+ messages in thread
From: sekhar raja @ 2001-11-26 12:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: manamraja

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Doubt in Kernel Timers
  2001-11-26 12:55 Doubt in Kernel Timers sekhar raja
@ 2001-11-26 17:58 ` george anzinger
  2001-11-27  5:36 ` Evgeniy Polyakov
  1 sibling, 0 replies; 5+ messages in thread
From: george anzinger @ 2001-11-26 17:58 UTC (permalink / raw)
  To: sekhar raja; +Cc: linux-kernel

sekhar raja wrote:
> 
> 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
> 
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.
-- 
George           george@mvista.com
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Real time sched: http://sourceforge.net/projects/rtsched/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Doubt in Kernel Timers
  2001-11-26 12:55 Doubt in Kernel Timers sekhar raja
  2001-11-26 17:58 ` george anzinger
@ 2001-11-27  5:36 ` Evgeniy Polyakov
  2001-11-27  7:08   ` sekhar raja
  1 sibling, 1 reply; 5+ messages in thread
From: Evgeniy Polyakov @ 2001-11-27  5:36 UTC (permalink / raw)
  To: sekhar raja; +Cc: linux-kernel

On Mon, 26 Nov 2001 04:55:17 -0800 (PST)
sekhar raja <manamraja@yahoo.com> wrote:

> 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.


> Thanks in Advance
> -Rajasekhar 
---
WBR. //s0mbre

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Doubt in Kernel Timers
  2001-11-27  5:36 ` Evgeniy Polyakov
@ 2001-11-27  7:08   ` sekhar raja
  2001-11-27  7:57     ` Evgeniy Polyakov
  0 siblings, 1 reply; 5+ messages in thread
From: sekhar raja @ 2001-11-27  7:08 UTC (permalink / raw)
  To: johnpol; +Cc: linux-kernel


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

--- Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:
> On Mon, 26 Nov 2001 04:55:17 -0800 (PST)
> sekhar raja <manamraja@yahoo.com> wrote:
> 
> > 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.
> 
> 
> > 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Doubt in Kernel Timers
  2001-11-27  7:08   ` sekhar raja
@ 2001-11-27  7:57     ` Evgeniy Polyakov
  0 siblings, 0 replies; 5+ messages in thread
From: Evgeniy Polyakov @ 2001-11-27  7:57 UTC (permalink / raw)
  To: sekhar raja; +Cc: linux-kernel

On Mon, 26 Nov 2001 23:08:45 -0800 (PST)
sekhar raja <manamraja@yahoo.com> wrote:

> 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.

> 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().

> 
> Thanks in Advance
> -Rajasekhar
> 
---
WBR. //s0mbre

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-11-27  7:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-26 12:55 Doubt in Kernel Timers sekhar raja
2001-11-26 17:58 ` george anzinger
2001-11-27  5:36 ` Evgeniy Polyakov
2001-11-27  7:08   ` sekhar raja
2001-11-27  7:57     ` Evgeniy Polyakov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox