Hi,

libeio manual says that EIO_STACKSIZE, if set to 0, leaves
pthread stack size at its default value:

--quote
If it is defined, but 0, then the default operating system stack
size will be used.
--end quote

In fact, if EIO_STACKSIZE is defined, but 0, the stack size used
is PTHREAD_STACK_MIN:

--quote: x_thread.h
pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN < X_STACKSIZE ? X_STACKSIZE 
: PTHREAD_STACK_MIN);
--end quote

(X_STACKSIZE is defined to EIO_STACKSIZE).

PTHREAD_STACK_MIN on my system is 16K, whereas the default stack 
size is 8M. 

It would be nice if the code is fixed to follow the docs:
setstacksize shouldn't be called at all if X_STACKSIZE is 0.

On a side note, having read the discussion from a few years
ago http://lists.schmorp.de/pipermail/libev/2009q2/000661.html 
it seems that EIO_STACKSIZE, as a default for all threads is
indeed a rather crude solution for the problem, while thread
groups, mentioned in the thread, a rather sophisticated, but
perhaps unnecessary.

It seems that all that is necessary is to ensure that EIO_CUSTOM 
requests can be handled by threads with a configurable stack size
-- this will solve all the known issues with libeio and stack
size.

PS eio.pod seems to be broken with regard to EIO_STACKSIZE as
well, it doesn't mention the name of the constant, only its
description:

--quote
These symbols, if used, must be defined when compiling eio.c.


(nada)
--end quote

Thanks!

-- 
http://tarantool.org - an efficient, extensible in-memory data store

_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to