Re: [RFC] libdispatch (aka Grand Central Dispatch) in base

From: Teske, Devin <Devin.Teske_at_fisglobal.com>
Date: Wed, 30 Oct 2013 05:06:38 +0000
On Oct 29, 2013, at 9:01 PM, Nathan Whitehorn wrote:

> On 10/29/13 21:04, Teske, Devin wrote:
>> Hi all,
>> 
>> I'd like to bring up the discussion for topic..
>> 
>> Importing libdispatch (aka Apple's Grand Central Dispatch) into base (contrib?).
>> 
>> Specifically into HEAD then MFC'd only as far back as stable/10.
>> 
>> Here's the reason why:
>> http://devinteske.com/freebsd-installer-enhancements
>> 
>> Summary:
>> For the purpose of providing a concurrency model better than pthreads for the
>> expressed desire to bring about concurrent data processing (applicable directly
>> to distributions, packages, signing and more).
>> 
>> Multiple people have confirmed with me with respect to the above blog article
>> that the concurrency model would be most efficient with libdispatch.
>> 
>> Since the tool mentioned in the blog is
>> a. Compiling with clang
>> b. Requires newest dialog(3) that is only in stable/10 or higher
>> 
>> I'd say that it looks like a match made in heaven.
>> 
>> But of course, there's that one hang-up... dispatch is not available in base yet.
>> 
>> Is anyone working on getting dispatch into base?
> 
> I have no opinion on GCD in base -- probably a good idea -- but I was hoping you could explain further what you are trying to do here. Parallelism in these steps is usually of very limited utility. For checksum evaluation, it could speed things up on multicore systems. For fetch and extract, however, it either has no effect (if you are bandwidth limited during fetch) or slows things down significantly by causing extra seeks. This problem is especially bad for CD installs. For extract, it can actually cause lasting problems on the installed system by increasing disk fragmentation.

The parallel concurrency was actually an after-thought.

First... I started with this...
http://pastebin.com/LvDtJNGh

A straight-forward attempt to see if I could add X11 support
by finding a feature that dialog(1) and Xdialog(1) agree upon.

They agree that when they are reading pipe data for the gauge
widget, they will update their prompt text when the input looks like:

XXX
New prompt text
XXX

NB: Literally "XXX" on a line by itself, sandwiching the new prompt.

I then quickly rewrote that into C and added dozens of features to
get where the fdpv prototype is at now.

I'm glad we're having this discussion, because I acknowledge that
I very well can push ahead without concurrency (and we may want
to do that, because the utility brings other benefits that are foremost
on my list behind parallelism).

Trying to achieve:

1. X11 support
2. Get rid of the need for temporary files (without sacrificing signing)
3. Internationalization

So would you recommend just moving forward without the parallelism
so we could add that as a value-add down the line?

That would actually speed up the development of fdpv as a new base
utility that can take either stdin or a list of fifo's with size and signature
data, and verify the data before forking off a tar command, or pkg etc.
-- 
Devin

_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
Received on Wed Oct 30 2013 - 04:07:22 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:43 UTC