Marc Lehmann schmorp at
Sat Jan 19 00:52:48 CET 2013

On Fri, Jan 18, 2013 at 09:54:02PM +0400, Konstantin Osipov <kostja.osipov at> wrote:
> libeio manual says that EIO_STACKSIZE, if set to 0, leaves
> pthread stack size at its default value:

Thats a (documentation) bug, thanks for pointing it out.

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

The problem is that (p-)threads do not have configurable stack size - the
stack size has to be set at creation time and can't be changed afterwards.

Note also that the solution to having your own threadpool is simply...
having your own threadpool. libeio does not need any configurable
stack size, and EIO_STACKSIZE is simply an additional rarely useful
feature. Using it for gethostbyname or similar functions is already a
design bug, and only useful for hacks.

Anything you seem to want out of it is likely not what eio is designed
for, and will interfere with libeios normal operation in negative
ways. There is no need to support these bad uses further, especially not at
the expense of bloating libeio.

I once made an attempt to outbundle some "libetp" (e thread pool) library
for this purpose, but that's not likely to happen anytime soon. Doing that
is certainly the right solution though.

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

My copy of eio.pod clearly mentions the name of the constant and it's
description, just in the section you quoted.

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_    
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at
      -=====/_/_//_/\_,_/ /_/\_\

More information about the libev mailing list