Re: The new GTask name in GIO is wrong



On 11/02/2012 10:15 AM, Tal Hadad wrote:
> First, there were an old project called GTask[0]

Yes, but people building on top of glib shouldn't use a plain "G" prefix
in their names... we can't just let everyone with an ftp server be able
to "steal" potential names from us.

> But the real problem is not project GTask confusion, but the fact you
> defined "Task" as
> async-method-internal implication to GAsyncResult.

It's not just for async though (which is part of what led to the "task"
name); there's also g_task_run_in_thread_sync() for running a task
synchronously (and sharing the implementation with an async task).

> Also, I suppose that on some stage of GLib, it would have GParallelTask,
> GParallelFor, etc.,
> i.e. something similar to .Net Task Parallel Library (TPL)[1].

I don't think you can safely assume that any future stage of glib will
have any particular API.

And anyway, http://msdn.microsoft.com/en-us/library/dd537609.aspx says:
"A task represents an asynchronous operation".

(Although TPL is different from GTask in that the task objects are
visible to the caller, rather than being implementation-internal as in
glib. Still, if glib was eventually going to shift to a Twisted/TPL/etc
style model [which would be a huge change], the GTask object would be a
usable base for that, as long as it had a clear separation between
task-internal and task-external API, in the way that, say, GCancellable
does.)

-- Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]