D, Unit_Threaded, and GtkD
Russel Winder
russel at winder.org.uk
Mon May 18 09:07:42 UTC 2020
On Sun, 2020-05-17 at 20:32 +0000, Luis via Digitalmars-d-learn wrote:
> On Sunday, 17 May 2020 at 10:19:38 UTC, Russel Winder wrote:
> > I am experimenting with using manual control of the Glib event
> > loop using the pending and iteration methods on the default
> > MainContext within each unit- threaded test. The alternative of
> > running a GTK application and then putting the tests in as an
> > asynchronous sequence only works with Rust and Python since D
> > has no coroutines of any sort.
> >
>
> A Fiber can't be used for this ? D Fibers don't have a scheduler.
> Yielding returns to the caller context.
> https://dlang.org/phobos/core_thread_fiber.html
Futures based co-routines with an executor could do it, but without some form
of scheduling, manual control is needed. In fact I think spawning an OS thread
is probably a better route, the Glib event loop can then run as it wants being
controlled via events being placed on it's queue from another thread.
--
Russel.
===========================================
Dr Russel Winder t: +44 20 7585 2200
41 Buckmaster Road m: +44 7770 465 077
London SW11 1EN, UK w: www.russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20200518/803d606c/attachment.sig>
More information about the Digitalmars-d-learn
mailing list