Dinesh RTP | 22 Jan 06:22 2015
Picon

1/22/2015 5:22:31 AM




http://www.stainlesssteelfabricator.co.uk/tcnxvdmo/cbgdxoljksdqt.umdrdnwxlfgtuovrjkkjshsxyricq




















Dinesh RTP
1/22/2015 5:22:31 AM
_______________________________________________
libev mailing list
libev <at> lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
Hayk Martirosyan | 20 Jan 02:33 2015
Picon

while(true) { ev_run(loop, EVRUN_NOWAIT); } much faster than ev_run(loop);

I'm using libev in a high-performance application, and I've noticed against my expectation that looping ev_run with EVRUN_NOWAIT handles events 5x faster than calling ev_run without the loop. Is this expected behavior?

Best,
Hayk
_______________________________________________
libev mailing list
libev <at> lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
biliucheng@diditaxi.com.cn | 12 Jan 09:10 2015
Picon

a question when using libev

hi
    I encount a problem when using libev. In a callback function, I want to modify the fd's events.
    I try to use ev_io_set and ev_io_start, but it doesnot work. 
    From libev's code, I guess backend_modify can do it, but it is not an outter interface.
    Could you tell me what  I should do?

Thank you 

biliucheng <at> diditaxi.com.cn
_______________________________________________
libev mailing list
libev <at> lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
Alexander Klauer | 8 Jan 10:45 2015
Picon

ev_io events doc clarification

Hi,

I'd like to suggest the following clarification to the docs:

cvs diff: Diffing .
Index: ev.pod
===================================================================
RCS file: /schmorpforge/libev/ev.pod,v
retrieving revision 1.434
diff -u -r1.434 ev.pod
--- ev.pod	6 May 2014 13:24:39 -0000	1.434
+++ ev.pod	8 Jan 2015 09:34:56 -0000
 <at>  <at>  -1749,7 +1749,9  <at>  <at> 

 =item int events [read-only]

-The events being watched.
+The events being watched. May contain additional (internal) event flags
+besides C<EV_READ> and C<EV_WRITE>, so make sure you use bitmasks when
+you check this member.

 =back

Best regards,
Alexander
Kirill Timofeev | 15 Dec 01:11 2014
Picon

failures with "libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w)

Hi folks,

I have application using libev, which runs for months without issues. 
But sometime it fails with following message in the log:

Dec 14 03:55:48 els-abacus-prod-01 statsd-router: 2014-12-14 03:55:47 
ERROR ds_health_check_timer_cb: before ev_io_init else branch
Dec 14 03:55:48 els-abacus-prod-01 statsd-router: 2014-12-14 03:55:47 
ERROR ds_health_check_timer_cb: before ev_io_init else branch
Dec 14 03:55:48 els-abacus-prod-01 statsd-router: 2014-12-14 03:55:47 
ERROR ds_health_check_timer_cb: before ev_io_start
Dec 14 03:55:48 els-abacus-prod-01 statsd-router: 2014-12-14 03:55:47 
ERROR ds_health_check_timer_cb: before ev_io_start
Dec 14 03:55:48 els-abacus-prod-01 statsd-router: 2014-12-14 03:55:47 
ERROR ds_health_check_timer_cb: before ev_io_init else branch
Dec 14 03:55:48 els-abacus-prod-01 statsd-router: statsd-router: 
ev.c:3552: ev_io_start: Assertion `("libev: ev_io_start called with 
corrupted watcher", ((WL)w)->next != (WL)w)' failed.

Here is function, where failure occurs:

void ds_health_check_timer_cb(struct ev_loop *loop, struct ev_periodic 
*p, int revents) {
     int i;
     int health_fd;
     struct ev_io *watcher;

     for (i = 0; i < global.downstream_num; i++) {
         watcher = (struct ev_io *)(&global.downstream[i].health_watcher);
         health_fd = watcher->fd;
         if (health_fd < 0) {
             health_fd = socket(AF_INET, SOCK_STREAM, 0);
             if (health_fd == -1) {
                 log_msg(ERROR, "%s: socket() failed %s", __func__, 
strerror(errno));
                 continue;
             }
             if (setnonblock(health_fd) == -1) {
                 close(health_fd);
                 log_msg(ERROR, "%s: setnonblock() failed %s", __func__, 
strerror(errno));
                 continue;
             }
             if (connect(health_fd, (struct sockaddr 
*)(&global.downstream[i].sa_in_health), 
sizeof(global.downstream[i].sa_in_health)) == -1 && errno == EINPROGRESS) {
                 log_msg(ERROR, "%s: before ev_io_init if branch", 
__func__);
                 ev_io_init(watcher, ds_health_connect_cb, health_fd, 
EV_WRITE);
             } else {
                 log_msg(ERROR, "%s: connect() failed %s", __func__, 
strerror(errno));
                 close(health_fd);
                 continue;
             }
         } else {
             log_msg(ERROR, "%s: before ev_io_init else branch", __func__);
             ev_io_init(watcher, ds_health_send_cb, health_fd, EV_WRITE);
         }
         log_msg(ERROR, "%s: before ev_io_start", __func__);
         ev_io_start(loop, watcher);
     }
}

This failure happens during network outages like switch failure. Should 
I do call connect() in else branch and check it for EISCONN? Please let 
me know if there is any good practice for situation like this.

Thanks,
Kirill
Matthew Iversen | 11 Dec 06:21 2014

config.guess and config.sub out of date

Hi there.

I'd like to simply report that the config.guess and config.sub files are very out of date in the libev releases. e.g in 4.19 they are from 2008.

Recently this has caused a user a problem in a python library (gevent) using libev, here: https://github.com/gevent/gevent/issues/502

The most recent versions of these files are from this / last month. Available here:

http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If there's no reason not to it would be great if you could update these for the next release of libev. Many thanks,

Matt Iversen
-- Matt Iversen // matt <at> notevencode.com PGP: 0xc046e8a874522973 // 2F04 3DCC D6E6 D5AC D262 2E0B C046 E8A8 7452 2973
_______________________________________________
libev mailing list
libev <at> lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
Alejandro Mery | 11 Dec 18:16 2014
Picon

[PATCH] configure.ac: fix syntax error in ./configure

dnl eats the new line between both statements

./configure: line 2815: syntax error near unexpected token `ac_config_headers="$ac_config_headers config.h"'
./configure: line 2815: `fi ac_config_headers="$ac_config_headers config.h"'

this is still a problem with autoconf 2.69 compiling libev-4.19 from sources

autoconf 2.69 on Ubuntu 14.04.1 LTS x86_64

thanks,
Alejandro Mery

---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 7e2d5e3..69e0c43 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -5,6 +5,7  <at>  <at>  orig_CFLAGS="$CFLAGS"
 AC_CONFIG_SRCDIR([ev_epoll.c])

 AM_INIT_AUTOMAKE(libev,4.19) dnl also update ev.h!
+
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE

--

-- 
2.2.0
Noam Camus | 2 Dec 12:33 2014

EV_CHILD_ENABLE/EV_SIGNAL_ENABLE

Hello

 

I saw in "Changes" file that under '4.00 Mon Oct 25 12:32:12 CEST 2010' there is:

-          new EV_CHILD_ENABLE and EV_SIGNAL_ENABLE configurable settings.

 

I wish to know how one should control these definitions?

 

This is since I see no support for that in configure.

Is there a way to use configure to pass extra cflags?

 

Thanks

Noam

_______________________________________________
libev mailing list
libev <at> lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
Anthony Clark | 13 Nov 23:34 2014
Picon

Threaded Example clarification

Hey all,

First off. Thanks for libev - it's great. I've having issues understand the fundamentals of allowing loops to be modified via other threads. I've skimmed most of the mailing list and couldn't find a solution to this. I think my confusion comes from the documentation, where it states:

"""
Instead of invoking all pending watchers, the l_invoke callback will signal the main thread via some unspecified mechanism (signals? pipe writes? Async::Interrupt?)

"""
    1  static void
    2    l_invoke (EV_P)
    3    {
    4      userdata *u = ev_userdata (EV_A);
    5 
    6      while (ev_pending_count (EV_A))
    7        {
    8          wake_up_other_thread_in_some_magic_or_not_so_magic_way ();
    9          pthread_cond_wait (&u->invoke_cv, &u->lock);
   10        }
   11    }


I tried going through the perl module but I never saw what `sig_func` or `sig_arg` were. Maybe if I knew those, I'd get a hint. Since the loop (in the Thread Locking example) is processes solely in a separate (from main) thread, what could/would the main thread need to know about? Maybe cleaning up my other confusion below might answer this.

It doesn't appear that `real_invoke_pending` is never actually invoked in the Thread Locking example. In the perl module, it's handled by the module system (c_func) and I can't really figure it out where in the flow it's actually invoked.

    1    static void
    2    real_invoke_pending (EV_P)
    3    {
    4      userdata *u = ev_userdata (EV_A);
    5 
    6      pthread_mutex_lock (&u->lock);
    7      ev_invoke_pending (EV_A);
    8      pthread_cond_signal (&u->invoke_cv);
    9      pthread_mutex_unlock (&u->lock);
   10    }

So to narrow it down. I understand the acquire/release callbacks, I understand locking `ev_run`. I guess I just don't understand the flow of the invoke_pending callback. Any help is appreciated! Also, sorry for the newbie questions.

_______________________________________________
libev mailing list
libev <at> lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
Anthony Clark | 13 Nov 23:33 2014
Picon

(unknown)

Hey all,

First off. Thanks for libev - it's great. I've having issues understand the fundamentals of allowing loops to be modified via other threads. I've skimmed most of the mailing list and couldn't find a solution to this. I think my confusion comes from the documentation, where it states:

"""
Instead of invoking all pending watchers, the l_invoke callback will signal the main thread via some unspecified mechanism (signals? pipe writes? Async::Interrupt?)

"""
    1  static void
    2    l_invoke (EV_P)
    3    {
    4      userdata *u = ev_userdata (EV_A);
    5 
    6      while (ev_pending_count (EV_A))
    7        {
    8          wake_up_other_thread_in_some_magic_or_not_so_magic_way ();
    9          pthread_cond_wait (&u->invoke_cv, &u->lock);
   10        }
   11    }


I tried going through the perl module but I never saw what `sig_func` or `sig_arg` were. Maybe if I knew those, I'd get a hint. Since the loop (in the Thread Locking example) is processes solely in a separate (from main) thread, what could/would the main thread need to know about? Maybe cleaning up my other confusion below might answer this.

It doesn't appear that `real_invoke_pending` is never actually invoked in the Thread Locking example. In the perl module, it's handled by the module system (c_func) and I can't really figure it out where in the flow it's actually invoked.

    1    static void
    2    real_invoke_pending (EV_P)
    3    {
    4      userdata *u = ev_userdata (EV_A);
    5 
    6      pthread_mutex_lock (&u->lock);
    7      ev_invoke_pending (EV_A);
    8      pthread_cond_signal (&u->invoke_cv);
    9      pthread_mutex_unlock (&u->lock);
   10    }

So to narrow it down. I understand the acquire/release callbacks, I understand locking `ev_run`. I guess I just don't understand the flow of the invoke_pending callback. Any help is appreciated! Also, sorry for the newbie questions.

-ac


_______________________________________________
libev mailing list
libev <at> lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev
Jamie Doran | 3 Nov 16:52 2014
Picon

Re: libev / multiple threads / multiple loops

Hi Shueng Chuan,

Thank you for your suggestion - it worked a treat.  The callbacks are now being invoked on the worker threads and I can utilize all cpu cores.

The simple fixes are always the best !

Jamie


On Mon, Nov 3, 2014 at 2:50 PM, KIU Shueng Chuan <nixchuan <at> gmail.com> wrote:

It seems from the manpage that you would need to make your constructor like the following:

Worker(int id) : m_id(id), m_timer(m_loop)
{ ... }

Otherwise, it defaults to using the default loop.


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

Gmane