Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3

From: Evgeniy Polyakov
Date: Tue Feb 27 2007 - 07:46:46 EST


On Tue, Feb 27, 2007 at 01:13:28PM +0100, Ingo Molnar (mingo@xxxxxxx) wrote:
>
> * Evgeniy Polyakov <johnpol@xxxxxxxxxxx> wrote:
>
> > > [...] But it is true that for most kernel programmers, threaded
> > > programming is much easier to understand, and we need to engineer
> > > the kernel for what will be maintainable for the majority of the
> > > kernel development community.
> >
> > I understand that - and I totally agree.
>
> why did you then write, just one mail ago, the exact opposite:
>
> > And debugging state machine code has exactly the same complexity as
> > debugging multi-threading code - if not less...

Because thread machinery is much more complex than event one - just
compare amount of code in scheduler and the whole kevent -
kernel/sched.c has about the same size as the whole kevent :)

> the kernel /IS/ multi-threaded code.
>
> which statement of yours is also patently, absurdly untrue.
> Multithreaded code is harder to debug than process based code, but it is
> still a breeze compared to complex state-machines...

It seems that we are talking about different levels.

Model I propose to use in userspace - very simple events mostly about
completion of the request - they are simple to use and simple to debug.
It can be slightly more hard to debug, than the simplest threading model
(one thread - one logical entity, which whould never work with others)
though.

>From userspace point of view it is about the same complexity to check
why event is not marked as ready, or why some thread never got
scheduled...
And we do not get into account possible synchronization methods needed
to run multithreaded code without problems.

> Ingo

--
Evgeniy Polyakov
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/