summaryrefslogtreecommitdiff
path: root/source4/lib/events/events_epoll.c
AgeCommit message (Collapse)AuthorFilesLines
2007-12-21r25676: fixed a valgrind error in the epoll event backend. The linked listAndrew Tridgell1-3/+2
could get mucked up. (This used to be commit 67240f380b2828eb85463ab2d256ae601f57348f)
2007-10-10r25027: Fix more warnings.Jelmer Vernooij1-1/+1
(This used to be commit 5085c53fcfade614e83d21fc2c1a5bc43bb2a729)
2007-10-10r24502: More work to get LOCAL-EVENT passing on all platforms:Andrew Bartlett1-11/+18
- Make the epoll_event_context_init() call fail if epoll_create() fails. This should cause this backend to be skipped on host with epoll() in libc but not in the kernel. - At the moment, there is no sensible way to handle failures to add an epoll() event, and 'fallback to select' is misnamed (so we now abort()). Andrew Bartlett (This used to be commit fb1e1eebdae740a2b66ee1ea9e1e35f21292ac14)
2007-10-10r23792: convert Samba4 to GPLv3Andrew Tridgell1-3/+2
There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa)
2007-10-10r23301: merged from ctdbAndrew Tridgell1-0/+2
(This used to be commit 76b981fcefb0dff24ac7d543da70fbb487ed7072)
2007-10-10r22970: the events code calls close(), which needs to use socket_wrapper.h inAndrew Tridgell1-0/+1
the build farm (This used to be commit 603d8b6f1702d10234b81ccde0649d8be63ae616)
2007-10-10r22968: andrew bartlett pointed out that the parent process could add a fd toAndrew Tridgell1-11/+11
the epoll context which would then appear in the children. To fix this we need to check for pid changes in more places. Luckily on platforms where we have epoll(), getpid() is very very cheap. (This used to be commit 4f84e6d569f9c9d7dd902f4550735f3ce2d3b424)
2007-10-10r22964: log an error on epoll_create failing on reopenAndrew Tridgell1-0/+1
(This used to be commit a69f28599845d3ea3868a574c6b0ba8db8486ef5)
2007-10-10r22963: fixed the epoll/fork interaction in the epoll and aio backendsAndrew Tridgell1-0/+44
(This used to be commit aeca07659aa612bee0c4dd6bdbb24c799e912909)
2007-10-10r22830: merged the latest lib/events updates from ctdb to Samba4. ThisAndrew Tridgell1-2/+9
includes a new EVENT_FD_AUTOCLOSE flag that prevents race conditions where code using fd events might close a fd before releasing the struct fd_event. That causes headaches for epoll. (This used to be commit f1ad216de13b154a1f8747a44b0970dcc47a784a)
2007-10-10r22661: optimize the handling of directly triggered timed events:Stefan Metzmacher1-4/+3
- if someone adds a timed_event with a zero timeval we now avoid serval gettimeofday() calls and the event handler doesn't get the current time when it's called, instead we also pass a zero timeval - this also makes sure multiple timed events with a zero timeval are processed in the order there're added. the little benchmark shows that processing 2000000 directly timed events is now much faster, while avoiding syscalls at all! > time ./evtest (with the old code) real 0m6.388s user 0m1.740s sys 0m4.632s > time ./evtest (with the new code) real 0m1.498s user 0m1.496s sys 0m0.004s metze@SERNOX:~/devel/samba/4.0/samba4-ci/source> cat evtest.c #include <stdio.h> #include <stdint.h> #include <sys/time.h> #include <talloc.h> #include <events.h> static void dummy_fde_handler(struct event_context *ev_ctx, struct fd_event *fde, uint16_t flags, void *private_data) { } static void timeout_handler(struct event_context *ev, struct timed_event *te, struct timeval tval, void *private_data) { uint32_t *countp = (uint32_t *)private_data; (*countp)++; if (*countp > 2000000) exit(0); event_add_timed(ev, ev, tval, timeout_handler, countp); } int main(void) { struct event_context *ev; struct timeval tval = { 0, 0 }; uint32_t count = 0; ev = event_context_init(NULL); event_add_fd(ev, ev, 0, 0, dummy_fde_handler, NULL); event_add_timed(ev, ev, tval, timeout_handler, &count); return event_loop_wait(ev); } (This used to be commit 4db64b4ce2320b88d648078cbf86385f6fb44f1f)
2007-10-10r22634: make the events system much less dependent on the samba4 build systemAndrew Tridgell1-4/+14
(This used to be commit b0c8c1cd21e3f91431504d70a4bc0d3c6dee6071)
2007-10-10r21171: fixed a bug related to recursive event handling.Andrew Tridgell1-1/+1
If this happens: - two sockets are readable, and select/epoll/aio returns both of them - read event on socket1 is called - inside that read event an event_loop_once is called, this returns that socket2 is readable - read event on socket2 is called - event_loop_once returns - top level event handler then calls read event on socket2 (as it still has that listed as readable) - read handler for socket2 returns zero byte read, which is interpreted as end of file - socket is incorrectly closed this happened with ctdb, but it could happen anywhere (just rarely). The fix is trivial - ensure we break out of the event loop when we have been called recursively. (This used to be commit e042002bb5ee8974220e1ade56b64389571f75a6)
2007-10-10r20928: added signal events to lib/eventsAndrew Tridgell1-0/+12
Jeremy asked for this to allow Samba3 to use the Samba4 events library see torture/local/event.c for an example (This used to be commit 7e105482ff9a3da6b4708ff99a64f1881614fc5f)
2007-10-10r20788: - remove epoll configure checks from libreplaceStefan Metzmacher1-1/+1
- fix epoll configure checks for the epoll and aio events backends - we should only activate the epoll backend if sys/epoll.h and epoll_create() are found - we should only activate the aio backend if sys/epoll.h, epoll_create(), libaio.h and io_getevents() are found hopefully fix the build on 'bnhtest' in the build farm... metze (This used to be commit d46a5efb03ea1df50567cad00e1589870cdb31fe)
2007-10-10r20539: - split the common timer related events code into events_timed.cAndrew Tridgell1-0/+407
- make it easier to plug in a new events backend - add simpler 'select' and 'epoll' backends This is part of the effort to add good AIO support. The events_aio.c backend is done, but sometimes dies with a SEGV, which is why it isn't enabled yet. (This used to be commit 934f18283dbc7958944931a93a854526bcd54884)