[DGD] Code libraries for DGD and Hydra
bart at wotf.org
bart at wotf.org
Fri Sep 21 15:46:32 CEST 2018
With the closures extension you can create a function pointer to a static
function, and pass that to another object, which can call that static function
despite it not being 'visible' to that object. If you provide the 'worker'
object as argument while creating the closure, you have something which can
only be created by the object that contains the static function, and is easy
to check for being used by the intended object, this all with relatively
little overhead.
Its quite possible to simulate this functionality without the closures
extension, so calling it syntactic sugar is technically correct. I do however
think the syntax makes the resulting code cleaner and easier to understand,
and also it should reduce some overhead due to being handled by the driver
instead of some lpc code.
I'd like the operator overloads you mention, and I can see how those might
help with the 'clean code' argument, but not with the overhead one, rather,
LWOs getting copied to the 'local' dataspace once a task finishes when passed
to another object makes me think it would introduce more overhead.
Bart.
On Fri, 21 Sep 2018 08:12:07 +0200, Felix A. Croes wrote
> bart at wotf.org wrote:
>
> >[...]
> > Shameless plug for some seemingly little used extension I use a lot.. the
> > closures extension would provide a clean way to let the called out worker
> > object do the call back for submitting its result in a more easily secured way
> > (as it lets you pass a static callback function)... (this and variations on it
> > are actually the only real reason why I am using that extension)
>
> The callback part could be done with continuations. Specifically,
> a distributed continuation allows you to call a function in a set of
> objects. That could be a set of size 1, after which there would be
> a callback to "aggregate" the results. Followup continuations could
> be appended in advance.
>
> The closures extension provides syntactical sugar for something that
> could also be done with a light-weight object encapsulating an
> object, a function and arguments. Perhaps what you are looking for
> is an extension of operator functions to * and ().
>
> Regards,
> Felix Croes
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
--
https://www.bartsplace.net/
https://wotf.org/
https://www.flickr.com/photos/mrobjective/
More information about the DGD
mailing list