Removal of 'stack_size' and 'bound' from threads in GLib



Hi everyone,

This is a proposal to get rid of the 'stack_size' and 'bound' parameters of
GLib's thread creation functions.

g_thread_create would then look like:

GThread* g_thread_create       (GThreadFunc            func,
                                gpointer               data,
                                gboolean               joinable,
                                GThreadPriority        priority,
                                GError               **error);

Why?

- 'stack_size' is not portable. It is ignored in Linux and I think, that the
default stack size will meet most users need on all platforms. Additionally it
is platform dependent, how much stack will be used by a given program, so it
can't be calculated portably by the programmer, so why bother using it. 

- Again 'bound' is ignored on Linux as every thread is bound. On other
platforms like Solaris a number of LWPs is automatically allocated for all
threads of a process, depending on how many threads want to run concurrently.
All in all it doesn't make sense to export this property. 

Yes I know, this could hurt us later, but I think leaving both parameters in
is worse, as it bloats the API with mostly unused parameters, which aren't
even portable at all.

If later there arises the urgent need for those parameters, I would rather add
functions g_thread_set_stack_size and g_thread_set_bound functions, which will
influence all subsequent thread creations within the current thread.

If there are no objections, I will remove those two parameters from GThread
and GThreadPool next week.

Bye,
Sebastian
-- 
Sebastian Wilhelmi
mailto:wilhelmi ira uka de
http://goethe.ira.uka.de/~wilhelmi




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