Tevent hacking

Timur I. Bakeyev timur at com.bat.ru
Sat Jul 25 17:22:56 MDT 2009


Hi,  Volker!

On Sat, Jul 25, 2009 at 06:50:27AM -0400, Volker Lendecke wrote:
> On Sat, Jul 25, 2009 at 02:42:19AM +0000, Timur I. Bakeyev wrote:
> 
> > >From looking into epoll() handling I got an impression, that we only
> > monitor file handlers, but from other side, I see something related to
> > signals and timers as well. So what's that exactly and what is an idea
> > behind? And why they implemented the way they implemented :)?
> 
> Signals are notoriously hard to get right. The tevent_signal
> thing abstracts away most of that ugliness. And, if you for
> example look at libev, that does not support the sigaction
> style signals we need for kernel oplock support.

Well, it'll be nice to get more details what is expected from such handling
and how alternative mechanisms of signals delivery can be used.

> And timers -- that's just an obvious thing to do IMO.

Mmm.. Not for me :) Timers could mean a lot of things and I'm not so
familiar with the tevent code to say what sort of timers it expects. Are
these just internal implementation, that delivers event after certain
interval? Or wrappers around timer_create() interface? Or setitimer()?
I'm really puzzled.

> > Both for epoll() and kqueue() it's possible to monitor delivery of the
> > signals to the process, and at least for kqueue it's possible to deliver
> 
> epoll() does signals? I did not know that, but that is
> really great!

Well, apparently thats quite new:

 signalfd() is available on Linux since kernel 2.6.22.  Working support
 is provided in glibc since version 2.8.  The signalfd4() system call is
 available on Linux since kernel 2.6.27.

The similar restriction applies to timerfd_create() interface.

 These system calls are available on Linux since kernel 2.6.25.  Library
 support is provided by glibc since version 2.8.

But again, my question - are these timers comparable with timers used by
tevent?

And, of course, I'd like to see, how it's all fit into the kqueue()
mechanism, which provides similar capabilities(and inspired epoll()
developers, I guess).

Oh, and, the most crucial one - how to test my new implementation :)?

With regards,
Timur.


More information about the samba-technical mailing list