openexr-devel
[Top][All Lists]
Advanced

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

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


From: darby johnston
Subject: Re: [Openexr-devel] OpenEXR from shared libs.
Date: Mon, 5 Mar 2007 13:46:37 -0800 (PST)

--- Florian Kainz <address@hidden> wrote:

> 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.

Checking cvs and google, it looks like AutoArray was
added for OSX 10.2, which had a default stack size of
512KB. When 10.3 came out it was bumped to 8MB.

> 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
> size?)

For both pthreads and windows the stack size is set
per thread.

> 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.

Good point.

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

How about a configure test that queries the limits and
sets which AutoArray to use?

I haven't looked at the code too closely; what would
you estimate the maximum stack size to be?


Darby





reply via email to

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