[Top][All Lists]

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

Re: try-this-for ?

From: tomas
Subject: Re: try-this-for ?
Date: Fri, 19 Jan 2018 12:22:08 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hash: SHA1

On Fri, Jan 19, 2018 at 11:47:55AM +0100, Emanuel Berg wrote:
> tomas wrote:
> > I'm actually enhancing one I wrote for
> > a customer ten years ago (C, GTK2). I have
> > written many of those. And I'm far from
> > a special snowflake.
> Yes, I have also written them (in C and C++)
> but never thought it to be really common and
> even Emacs does it in a poor-man's way compared
> to Unix.

No. It delegates this stuff to the OS, which is
(most of the time) the Right Thing to Do.

> If a process cannot even be preempted

It can be preempted, see signal. But even if you
want to get signals right, the most straightforward
way is to queue the event to take care of it at a
point where your program is ready to deal with it.
An operating system basically does the same. No magic
here, either.
>                                         one might
> as well extend the definition of "scheduling" to
> a OO game loop that progresses the animation
> state of a bunch of sprites in a linked list...

Everyone does it that way. Whether you use a linked
list or (forced by priorities) a red-black tree or
a heap doesn't change the basic concept. I once had
a program collecting messages from SCADA systems. I
started with a linked list for events and told the
customer it would hold up for about 1000 sensors in
the field. Then he came back with... 10K sensors. I
had to change to a heap implementation.

> > It's not magic. It's pretty "classical" as
> > Unix goes
> With Unix we think rather of PCBs, IPC, context
> switches, memory protection, different
> scheduling algorithms, on-the-fly and
> from-the-outside changes of priorities, and
> so on.

You try to delegate that to the OS: that's what it
is for. Even modern browsers, which have a dire need
for memory protection, just have separate processes
for that.

After all, I don't want even to think how to manage
things like the MMU from user space. Dragons is not
even an adequate description for that.

- -- tomás
Version: GnuPG v1.4.12 (GNU/Linux)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]