Re: Proposal: Enable threads by default



On 12/01/2009 03:36 PM, Alexander Larsson wrote:
> I don't think that is quite right. Its only safe to set this define if
> you can guarantee there is no calls to your code before g_type_init (or
> g_thread_init directly) is called.

Hrmph. Could potentially add a define which would cause a G_LIKELY() to
be added in to G_THREAD_CF() when linking to gobject... but we'd want to
test that it actually had a measurable effect first.

>> threads? Allowing threadless glib means we still need to have the
>> non-threaded versions of GIOScheduler, GResolver, etc, lying around,
>> but
>> they'll never get used in normal builds.
> 
> I wouldn't mind this, but on the other hand its not really a large
> maintainance burden, is it?

Continuing to maintain the existing code which we already know works is
not a large burden, but having to write non-threaded versions of *new*
APIs might suck (having to write *two* non-threaded versions of
GResolver did) and then after we write them they're never going to get
used and so they'll probably be all buggy anyway. And besides, who are
we providing the no-thread-support version for anyway? There used to be
some somewhat-relevant unixes without pthreads, but I don't think there
are any non-toy OSes that have that problem any more.

-- Dan


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