[Fwd: Adding GThreadPool API to set per-thread stack size]



I had sent this as a non-subscriber, but looks like the moderators
aren't around, so I'm resending as a subscriber.

Since sending this the first time, I found that g_thread_pool_new() used
to accept similar arguments to g_thread_create_full().  If adding a
g_thread_pool_new_full() isn't an option, what about a configurable
per-thread stack size in gthread-posix.c similar to the way the minimum
stack size is set?

I'd appreciate any suggestions.  Thanks.
-- 
Joe Marcus Clarke
FreeBSD GNOME Team	::	gnome FreeBSD org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome
--- Begin Message ---
The latest release of gnome-cups-manager exposed a problem with
GThreadPools on FreeBSD.  Each thread in a thread pool can only have the
default thread stack size.  On FreeBSD, this is 64 KB on most
architectures.  As it turns out, this is not big enough to do CUPS
operations within a thread, and thus gnome-cups-manager crashes with a
stack overflow.

I'm not sure what Linux uses as its default stack size (but I'd love
someone to tell me).  However, I think it might be beneficial to add an
API call to GThreadPool similar to g_thread_create_full().  This would
allow per-thread stack size to be specified.  My idea would be to add:

GThreadPool* g_thread_pool_new_full (GFunc func,
                                     gpointer user_data,
                                     gint max_threads,
                                     gulong stack_size,
                                     gboolean exclusive,
                                     GError **error);

This function would call g_thread_create_full() and pass the stack_size
argument.  The only other solution I could think of is to use some
arbitrary default stack size for all GThreads, but that seemed like too
much of a hack.

If I were to submit patches for this, would they be accepted?  Is this
worth pursuing or does someone have a better idea?  Thanks.

Joe

-- 
Joe Marcus Clarke
FreeBSD GNOME Team	::	gnome FreeBSD org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---

Attachment: signature.asc
Description: This is a digitally signed message part



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