[Top][All Lists]

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

Re: [Openexr-devel] OpenEXR from shared libs.

From: Florian Kainz
Subject: Re: [Openexr-devel] OpenEXR from shared libs.
Date: Mon, 05 Mar 2007 11:55:38 -0800
User-agent: Mozilla Thunderbird 1.0 (X11/20041207)

I think Paul is right; we added the AutoArray to IlmImf before
we added threading.  If I remember correctly, the AutoArray was
introduced specifically to address the small stack size on OS X.
Maybe this has changed, and the AutoArray is no longer necessary
on newer systems.

The IlmImf library should set the stack size only for threads it
creates; it should not interfere with the stack size for application
threads.  (Is it even possible for a thread to change its own stack

This brings up a disadvantage of changing the stack size: a thread
in a multithreaded application may use the small default stack size
and then call the IlmImf library in single-threaded mode (with the
number of threads set to 0).  In this case the AutoArrays will end
up on the application thread's small stack and cause a segfault.

Maybe it is better to use the heap-based AutoArray on systems where
threads have a small default stack size.


darby johnston wrote:
--- Paul Schneider <address@hidden> wrote:
But don't we want to keep the AutoArray around for
single-threaded code

I believe the default stack size for processes is much
larger than threads, so it shouldn't be an issue.

For instance, according to this the default stack size
in OSX is 8MB, but for pthreads is only 512KB:

so that the EXR library doesn't change the
stack size of the thread that calls it?

The change will be specific to the pthreads stuff, so
if you disable threading it won't affect anything.

-- Florian Kainz <address@hidden> wrote:

darby johnston wrote:
Also, could the ifdef for darwin in ImfAutoArray.h
removed with this change?
I don't know.  Have you tried it?

Unfortunately I don't have access to a mac, but the
above document seems to support it.


Openexr-devel mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]