Skip to contentSkip to conversation

repeat a function after fixed time period

DISCUSSION sounak chakraborty 2 participants 2 messages Mar 23, 2005 – Mar 24, 2005

lore
Share & tools
lore
#0 lore raw
Quoted 30 lines · --- linux-os
Quoted 7 lines · Arjan van de Ven
Quoted 6 lines · linux-os
Quoted 6 lines
Quoted 5 lines

static void start_timer(void)

{
     if(!atomic_read(&info->running))
     {
         atomic_inc(&info->running);
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

same race.

No such race at all.

here there is one; you use add_timer() which isn't

allowed on running

Quoted 1 line

timers, only mod_timer() is. So yes there is a

race.

Quoted 1 line

Well add_timer() is only executed after the timer has expired
or hasn't started yet so the "isn't allowed" is pretty broad.
If I should use mod_timer(), then there are a _lot_ of buggy
drivers in the kernel because that's how a lot repeat the
sequence. Will mod_timer() actually restart the timer???

Quoted 1 line

If so, I'll change it and thank you for the help.

i have applied the code
as i was intedded to call a function repeated ly in fork.c i written the code over there
it compiled smoothly
but while booting
it is showing
kernel panic no init found
kjournal starting .commit interval after 5 seconds

sounak

________________________________________________________________________
Yahoo! India Matrimony: Find your partner online. http://yahoo.shaadi.com/india-matrimony/

#1 lore raw
Quoted 44 lines · sounak chakraborty
Quoted 30 lines · --- linux-os
Quoted 7 lines · Arjan van de Ven
Quoted 6 lines · linux-os
Quoted 6 lines
Quoted 5 lines

static void start_timer(void)

{
     if(!atomic_read(&info->running))
     {
         atomic_inc(&info->running);
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

same race.

No such race at all.

here there is one; you use add_timer() which isn't

allowed on running

Quoted 1 line

timers, only mod_timer() is. So yes there is a

race.

Quoted 1 line

Well add_timer() is only executed after the timer has expired
or hasn't started yet so the "isn't allowed" is pretty broad.
If I should use mod_timer(), then there are a _lot_ of buggy
drivers in the kernel because that's how a lot repeat the
sequence. Will mod_timer() actually restart the timer???

Quoted 1 line

If so, I'll change it and thank you for the help.

i have applied the code
as i was intedded to call a function repeated ly in fork.c i written the code over there
it compiled smoothly
but while booting
it is showing
kernel panic no init found
kjournal starting .commit interval after 5 seconds

Quoted 2 lines

sounak

*** AWWK *** Sanity check failed.

Cheers,
Dick Johnson
Penguin : Linux version 2.6.11 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.