lkml.org 
[lkml]   [2005]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Add schedule_timeout_{interruptible,uninterruptible}{,_msecs}() interfaces
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-23 22:26    [W:0.109 / U:0.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site