[Toybox] Bad idea regarding threading...

David Seikel onefang at gmail.com
Mon Apr 30 00:39:43 PDT 2012


On Mon, 30 Apr 2012 09:25:37 +0200 Elie De Brauwer
<eliedebrauwer at gmail.com> wrote:

> On Sun, Apr 29, 2012 at 2:57 AM, Rob Landley <rob at landley.net> wrote:
> > It occurs to me that if I add a CONFIG_TOYBOX_THREADS with the new
> > directory traversal infrastructure, things like cp -a and rm -r
> > could be done in a multithreaded manner.
> >
> > I.E. create a thread pool equal to the number of processors, and
> > then every time you encounter a directory hand off the callbacks to
> > a thread out of the thread pool. Everything they're doing is
> > openat() based on a filehandle stored in the node structure (or a
> > filehandle pair with the second stored in the node's ->extra
> > field), so you don't need to worry about the current directory
> > changing in another thread...
> 
> Indeed, and I think that this could also be a very nice feature to
> differentiate toybox from similar tools, to my knowledge there aren't
> any 'userlands' availble which have inherent multithreading support
> (typically because most stem from the time that it was easier to
> purchase a human kidney than to purchase smp systems.
> The only thing I want to add there is that in such a scenario I expect
> the number of usable cores to be runtime configurable (e.g. through an
> environment variable).

Um, I would hope that the code figures out for itself how many cores
are available.  Perhaps you meant artificially limiting cores, to keep
some in reserve for something else?

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120430/45733ce1/attachment-0002.sig>


More information about the Toybox mailing list