On 19-11-2018 21:51, adnan wrote:

Hello I have to use parallel tasks for my application.
This involves creating a command line process and parsing a file created by the said process every half a second.

On the GDK side the thread init/enter/leave functions are deprecated,
and all UI calls into gtk should be made from the UI thread.

In that case you would use core.thread from druntime for your threading,
and setup a glib.Timeout to update the UI based on some shared state.

I see you are creating a new Timeout inside the loop, while glib.Timeout
will be called from the GTK mainloop, with at least the timeout between
calls, until it returns true. So you wouldn't want to do this in a loop.