Re: [PATCH] Add schedule_timeout_{interruptible,uninterruptible}{,_msecs}() interfaces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sat, 23 Jul 2005, Nishanth Aravamudan wrote:

> > What's wrong with just:
> > 
> > 	schedule_timeout_{,un}interruptible(msecs_to_jiffies(some_constant_msecs));
> 
> Nothing, I suppose. I just prefer directly using msecs. I understand
> your point more now, I think. You are worried about those people that
> actually use the return value of schedule_timeout().

It's only half the point:

> > The majority of users use a constant, which can already be converted at 
> > compile tile.

The kernel time unit is and will be jiffies and the kernel time functions 
should be in ticks with some optional wrappers in other time units, not 
the other way around.

> 2) Sleep in a loop, keeping track of remaining timeout each iteration:
> 
> 	while (timeout) {
> 		do_some_stuff();
> 		timeout = schedule_timeout(timeout);
> 		if (some_condition)
> 			break;
> 	}

This actually is a pre-preempt construct and should probably use 
time_before() now.

bye, Roman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux