Re: Error handling / ev_set_syserr_cb

2016-02-25 Thread Nick Zavaritsky
Hi, >> 1) UB from the libev point of view, or >> 2) works with certain versions of libev on certain OSes, but may break >> without warning, or >> 3) is fully supported and is a part of the public API contract. > > It's certainly 1 or 2. I am glad it was stated in clear now. Remember a discussi

Re: Error handling / ev_set_syserr_cb

2016-02-25 Thread Nick Zavaritsky
Hi, >> Hi Mark, > Still Marc, btw. Please kindly excuse me for the typo. >> Libev provides ev_set_syserr_cb() to customise error handling. >> >> I wonder, if longjump-ing from a error handler is supported. > > libev can't stop you, longjmp is part of the C language. Well, since pointers are

Error handling / ev_set_syserr_cb

2016-02-24 Thread Nick Zavaritsky
Hi Mark, Libev provides ev_set_syserr_cb() to customise error handling. I wonder, if longjump-ing from a error handler is supported. Consider a longjump removing all libev frames from the stack and landing at some location that was set up earlier. Are we going to get any leaks inside libev? Is

Re: ev_run() brakes - epoll_wait_nocancel

2016-01-09 Thread Nick Zavaritsky
Basically you are asking to debug the program for you. That rarely works. Sounds like a memory corruption to me. Did you try running it under valgrind/using ASAN? Also the source code is massive. Please provide a minimal code reproducing the issue. > On 09 Jan 2016, at 21:17, Gar|k wrote: >

Re: Several questions concerning libeio internals(+)

2015-12-16 Thread Nick Zavaritsky
> You need some communications mechanism for your threads - that's outside > the scope of libeio, really. > >> However since there’s the single result queue, it’s impossible to route the >> completed request to the particular thread. > > If it's impossible to route completed requests to the par

Re: Several questions concerning libeio internals(+)

2015-12-16 Thread Nick Zavaritsky
> As for queues, what in the single result queue doesn't work the way you > want? You can asociate state with each request either by making the > struct larger or using the data member, similarly to libev. Consider eio_open (const char *path, int flags, mode_t mode, int pri, eio_cb cb, void *da

Re: Several questions concerning libeio internals(+)

2015-12-16 Thread Nick Zavaritsky
> I think libeio already is usable form multiple threads? > >> eio_init() initializes thread local state; a thread gets a private result >> queue + callbacks. There is the single global request queue + a set of >> worker threads. Once a task is complete it moves into the corresponding >> resul

Several questions concerning libeio internals(+)

2015-12-15 Thread Nick Zavaritsky
Hi! I’ve implemented a support for using libeio from multiple threads for tarantool.org. Any interest in this feature? eio_init() initializes thread local state; a thread gets a private result queue + callbacks. There is the single global request queue + a set of worker threads. Once a task is

Re: Redundant epoll_ctl with ev_io watcher

2015-12-15 Thread Nick Zavaritsky
between R,W,RW modes is desired. Probably a relevant example in the docs will help? Regards. > On 07 Nov 2015, at 20:00, Marc Lehmann wrote: > > On Fri, Nov 06, 2015 at 05:25:38PM +0300, Nick Zavaritsky > wrote: >>> I don't quite see why you couldn't re

Re: coro: Asm coro_transfer for arm7

2015-12-07 Thread Nick Zavaritsky
Hi! > 1. in the header, you test for __arm__, but in the implementation, > you only support __ARM_ARCH=7, this will obviously fail. Is this an > oversight? I would assume testing for __ARM_ARCH everywhere is the right > fix? I am lacking the capacity to test it on every possible arm; so just play

Re: coro: Asm coro_transfer for arm7

2015-12-02 Thread Nick Zavaritsky
Hi! Sorry for nagging, but I’ve got no response on this. Could you please consider my patch? Thanks. > On 23 Nov 2015, at 16:20, Nick Zavaritsky wrote: > > Hi! > > Please consider the patch implementing CORO_ASM backend for arm7 arc

coro: Asm coro_transfer for arm7

2015-11-23 Thread Nick Zavaritsky
Hi! Please consider the patch implementing CORO_ASM backend for arm7 arch. Regards. coro_transfer_arm7.patch Description: Binary data ___ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/mailman/listinfo/libev

Re: Redundant epoll_ctl with ev_io watcher

2015-11-06 Thread Nick Zavaritsky
Hello, Marc Thank you very much for your help. > I don't quite see why you couldn't reuse the I/O watcher? I also use > coroutines, and typically it is possible to reuse the watcher (for > performance reasons, it is basically always faster to reuse watchers). Technically, reusing is possible, th

Redundant epoll_ctl with ev_io watcher

2015-11-05 Thread Nick Zavaritsky
Hi, Marc! Please kindly provide some advice. Tarantool.org is observing redundant epoll_ctl(EPOLL_CTL_ADD) when using ev_io watchers. Here is the (edited) strace fragment: read(7, 0x7f8a23008030, 16336) = -1 EAGAIN (Resource temporarily unavailable) epoll_ctl(4, EPOLL_CTL_ADD, 7, {EP

libeio broken in revision 1.139

2015-10-06 Thread Nick Zavaritsky
Hi Marc, We’ve updated to the latest libeio and we were very upset due to it crashing in etp_poll like crazy. The problem was due to want_poll/done_poll callbacks missing in the internal etp_pool object, obviously eio_init isn’t setting them. Attaching a patch to illustrate the point. Please

Unexpected periodic invocation of ev_check watcher

2015-03-12 Thread Nick Zavaritsky
Dear List, I have an ev_check watcher in my event loop and it gets invoked approximately every minute or so. There is no other activity happening and I assume that the loop should just stay idle instead. Is it the intended behavior? Regards. PS. The code sample. #include #include void cb(

Re: ev_io mode switching performance

2014-05-27 Thread Nick Zavaritsky
Hi! > Well, obviously, you need to call a function or macro every time you toggle > the flags. > > Apart from that, it doesn't matter whether you toggle once or many times per > event loop iteration - when libev polls for new events, it will tell the > backend about them. > > For select and poll

ev_io mode switching performance

2014-05-20 Thread Nick Zavaritsky
Hi! My program is repeatedly toggling an io watcher from R to RW mode and back. This may happen multiple times per one event loop iteration. This toggling behavior is caused because of me attempting to buffer a few data items before flush but certain conditions may force an early flush. Before bl

Re: Libev: embeding within a 'foreign' event loop

2014-05-02 Thread Nick Zavaritsky
Hi! > You would have to be prepared to handle a change to the fd at basically > any time, including a change to no fd. Excuse me my ignorance I didn't know that it was so complex. Now I realize that when libev has to tear things down and rebuilds everything from scratch in effort to cure after fo

Libev: embeding within a 'foreign' event loop

2014-05-01 Thread Nick Zavaritsky
Hi! I realy love the flexibility and the great design of libev, however I am a bit puzzled with the event loop embeding. The problem is that I want to mix and match code that uses libev event loop with the code tailored for a very different event loop environment, all in the same thread. This