libeio EIO_STACKSIZE

Konstantin Osipov kostja at tarantool.org
Wed Jan 23 15:11:20 CET 2013


* Marc Lehmann <schmorp at schmorp.de> [13/01/23 17:50]:
> Note also that the solution to having your own threadpool is simply...
> having your own threadpool.

Forking libeio is and (has always been with free software)
an obvious option.
I'm immensely thankful to you for libeio - it has already saved us
a lot of time, and will save even more, should we decide to use
something else or write/fork.

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

Do you care to elaborate why?

As far as I can see you've been bothered with this issue before
and it's a sensitive topic. Yet I have to admit I'm still clueless
at what the real technical issue is.

Is there any other reason why using libeio with host name resolution is a
hack, apart from the necessarily large stack size?

Personally, I'm not bothered much with need for a large stack
size, since on most modern hardware even 8M of stack is only
8M of virtual address space, which still leaves me with hundreds
of millions of threads (assuming 64-bit pointers).

> 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 always a possibility that the author meant one thing, and
the reader is seeing something the author did not intend.
So the real question is: what this library is good for today,
what are future directions, and how having (or not having) the
subject feature helps or harms these and existing purposes.

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

I'm not looking at eio.pod, I'm looking at this URL:

http://pod.tst.eu/http://cvs.schmorp.de/libeio/eio.pod

in particular this fragment:

</div>
<h1 id="COMPILETIME_CONFIGURATION">COMPILETIME CONFIGURATION</h1>
<div id="COMPILETIME_CONFIGURATION_CONTENT">
<p>These symbols, if used, must be defined when compiling <cite>eio.c</cite>.</p>
<p>This symbol governs the stack size for each eio thread. Libeio itself
was written to use very little stackspace, but when using <code>EIO_CUSTOM</code>
requests, you might want to increase this.</p>
<p>If this symbol is undefined (the default) then libeio will use its default
stack size (<code>sizeof (void *) * 4096</code> currently). In all other cases, the
value must be an expression that evaluates to the desired stack size.</p>

</div>

In fact, I can't find EIO_STACKSIZE anywhere in the html source.

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



More information about the libev mailing list