[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0702261159470.12485@woody.linux-foundation.org>
Date: Mon, 26 Feb 2007 12:04:51 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Evgeniy Polyakov <johnpol@....mipt.ru>
cc: Ingo Molnar <mingo@...e.hu>, Ulrich Drepper <drepper@...hat.com>,
linux-kernel@...r.kernel.org,
Arjan van de Ven <arjan@...radead.org>,
Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@....com.au>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Zach Brown <zach.brown@...cle.com>,
"David S. Miller" <davem@...emloft.net>,
Suparna Bhattacharya <suparna@...ibm.com>,
Davide Libenzi <davidel@...ilserver.org>,
Jens Axboe <jens.axboe@...cle.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 00/13] Syslets, "Threadlets", generic AIO support, v3
On Mon, 26 Feb 2007, Evgeniy Polyakov wrote:
>
> Will you argue that people do things like
> num = epoll_wait()
> for (i=0; i<num; ++i) {
> process(event[i])?
> }
I have several times told you that I argue for a *combination* of
event-bassed interfaces and thread-like code. And that the choice depends
on which is more natural. Sometimes you might have just one or the other.
Sometimes you have both. And sometimes you have neither (although,
strictly speaking, normal single-threaded code is certainly "thread-like"
- it's a serial execution, the same way threadlets are serial executions -
it's just not running in parallel with anything else).
> Will you spawn thread per IO?
Depending on what the IO is, yes.
Is that _really_ so hard to understand? There is no "yes" or "no". There's
a "depends on what the problem is, and what the solution looks like".
Sometimes the best way to do parallelism is through explicit threads.
Sometimes it is through whatever "threadlets" or other that gets out of
this whole development discussion. Sometimes it's an event loop.
So get over it. The world is not a black and white, either-or kind of
place. It's full of grayscales, and colors, and mixing things
appropriately. And the choices are often done on whims and on whatever
feels most comfortable to the person doing the choice. Not on some strict
"you must always use things in an event-driven main loop" or "you must
always use threads for parallelism".
The world is simply _richer_ than that kind of either-or thing.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists