From: Jorge on
On Feb 21, 10:51 am, David Schwartz <dav...(a)webmaster.com> wrote:
> On Feb 19, 3:29 pm, "novicki...(a)gmail.com" <novicki...(a)gmail.com>
> wrote:
>
> > I can not sleep for 1 millisecond only.
>
> In general, an ordinary, non-privileged process cannot sleep for 1
> millisecond other than by just wasting 1 millisecond of CPU. The
> problem is that this is too little time to sensibly give to another
> process.

Are you sure ?

In a machine running @ 2.5GHz, 1ms accounts for 2.5 million cycles !
Add to that today's big CPU caches plus that there's usually a 2nd
core running in parallel and... ?
--
Jorge.
From: David Schwartz on
On Feb 22, 1:23 am, Jorge <jo...(a)jorgechamorro.com> wrote:

> > In general, an ordinary, non-privileged process cannot sleep for 1
> > millisecond other than by just wasting 1 millisecond of CPU. The
> > problem is that this is too little time to sensibly give to another
> > process.

> Are you sure ?

Yeah.

> In a machine running @ 2.5GHz, 1ms accounts for 2.5 million cycles !

Right, but the problem is that as machines have gotten faster, the
work we've wanted to do on them has gotten bigger as well. So the
"relative value" of 1 ms hasn't really changed all that much.

> Add to that today's big CPU caches

That makes things worse. It makes the penalty for switching from one
chunk of code to another much greater.

> plus that there's usually a 2nd
> core running in parallel and... ?

That increase the penalty on typical systems. When you switch
processes, you blow out all the caches. This means the CPU puts a
drain on RAM to refill the caches. Generally, the path to RAM is
shared by all cores, so this makes the cost of small timeslices
relatively higher, not lower.

DS
From: Jorge on
On Feb 22, 12:54 pm, David Schwartz <dav...(a)webmaster.com> wrote:
> On Feb 22, 1:23 am, Jorge <jo...(a)jorgechamorro.com> wrote:
>
> > > In general, an ordinary, non-privileged process cannot sleep for 1
> > > millisecond other than by just wasting 1 millisecond of CPU. The
> > > problem is that this is too little time to sensibly give to another
> > > process.
> > Are you sure ?
>
> Yeah.
>
> > In a machine running @ 2.5GHz, 1ms accounts for 2.5 million cycles !
>
> Right, but the problem is that as machines have gotten faster, the
> work we've wanted to do on them has gotten bigger as well. So the
> "relative value" of 1 ms hasn't really changed all that much.

I wouldn't say so. My current laptop is certainly much faster than the
previous one, in spite of the new -latest- unix OS that comes with it.

> > Add to that today's big CPU caches
>
> That makes things worse. It makes the penalty for switching from one
> chunk of code to another much greater.
>
> > plus that there's usually a 2nd
> > core running in parallel and... ?
>
> That increase the penalty on typical systems. When you switch
> processes, you blow out all the caches. This means the CPU puts a
> drain on RAM to refill the caches.

Then, maybe we ought to get rid of the caches... :-)

> Generally, the path to RAM is
> shared by all cores, so this makes the cost of small timeslices
> relatively higher, not lower.

That's true. And the cache is -often- shared too.
--
Jorge.
From: Rick Jones on
Jorge <jorge(a)jorgechamorro.com> wrote:
> On Feb 22, 12:54?pm, David Schwartz <dav...(a)webmaster.com> wrote:

> > Right, but the problem is that as machines have gotten faster, the
> > work we've wanted to do on them has gotten bigger as well. So the
> > "relative value" of 1 ms hasn't really changed all that much.

> I wouldn't say so. My current laptop is certainly much faster than
> the previous one, in spite of the new -latest- unix OS that comes
> with it.

Be patient - a few more releases and the underlying expectations for
available resources will make your current laptop seem slow again :)

rick jones
--
the road to hell is paved with business decisions...
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
From: David Schwartz on
On Feb 22, 12:00 pm, Jorge <jo...(a)jorgechamorro.com> wrote:

> > Right, but the problem is that as machines have gotten faster, the
> > work we've wanted to do on them has gotten bigger as well. So the
> > "relative value" of 1 ms hasn't really changed all that much.

> I wouldn't say so. My current laptop is certainly much faster than the
> previous one, in spite of the new -latest- unix OS that comes with it.

Why did you buy a faster laptop then? Weren't you perfectly happy with
the old one? Can't it still do everything it did back then just as
well?

Hint: The answer is that what you want to do has changed because it
can. And the value of 1ms of CPU time relative to what you want to do
has therefore not changed very much. The net effect is that long term
the relative value of 1ms of an average CPU has stayed about the same.
It's 1ms of average.

DS
First  |  Prev  | 
Pages: 1 2 3 4
Prev: directories III
Next: 'netstat' and '-f inet' option