Commit 45286fa1 authored by Laughing's avatar Laughing Committed by GitHub

add pollset poller in AIX

add a new poller named pollset which will get benefit of performance in AIX platform.
parent 38931b2d
......@@ -77,7 +77,7 @@ if (WITH_MILITANT)
endif()
set (POLLER "" CACHE STRING "Choose polling system. valid values are
kqueue, epoll, devpoll, poll or select [default=autodetect]")
kqueue, pollset, epoll, devpoll, poll or select [default=autodetect]")
include (CheckFunctionExists)
include (CheckTypeSize)
......@@ -91,6 +91,15 @@ if (POLLER STREQUAL "")
endif()
endif ()
if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/pollset.h)
check_function_exists (pollset_create HAVE_POLLSET)
set (CMAKE_REQUIRED_INCLUDES)
if (HAVE_POLLSET)
set (POLLER "pollset")
endif()
endif ()
if (POLLER STREQUAL "")
set (CMAKE_REQUIRED_INCLUDES sys/epoll.h)
check_function_exists (epoll_create HAVE_EPOLL)
......@@ -136,6 +145,7 @@ if (POLLER STREQUAL "")
endif ()
if (POLLER STREQUAL "kqueue"
OR POLLER STREQUAL "pollset"
OR POLLER STREQUAL "epoll"
OR POLLER STREQUAL "devpoll"
OR POLLER STREQUAL "poll"
......@@ -468,6 +478,7 @@ set (cxx-sources
plain_server.cpp
poll.cpp
poller_base.cpp
pollset.cpp
precompiled.cpp
proxy.cpp
pub.cpp
......
......@@ -133,6 +133,8 @@ src_libzmq_la_SOURCES = \
src/poller.hpp \
src/poller_base.cpp \
src/poller_base.hpp \
src/pollset.cpp \
src/pollset.hpp \
src/precompiled.cpp \
src/precompiled.hpp \
src/proxy.cpp \
......
......@@ -794,6 +794,22 @@ kqueue();
)
}])
dnl ################################################################################
dnl # LIBZMQ_CHECK_POLLER_POLLSET([action-if-found], [action-if-not-found]) #
dnl # Checks pollset polling system #
dnl ################################################################################
AC_DEFUN([LIBZMQ_CHECK_POLLER_POLLSET], [{
AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#include <sys/poll.h>
#include <sys/pollset.h>
],[[
pollset_t ps = pollset_create(-1);
]])],
[$1], [$2]
)
}])
dnl ################################################################################
dnl # LIBZMQ_CHECK_POLLER_EPOLL_RUN([action-if-found], [action-if-not-found]) #
dnl # Checks epoll polling system can actually run #
......@@ -892,7 +908,7 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
# Allow user to override poller autodetection
AC_ARG_WITH([poller],
[AS_HELP_STRING([--with-poller],
[choose polling system manually. Valid values are 'kqueue', 'epoll', 'devpoll', 'poll', 'select', or 'auto'. [default=auto]])])
[choose polling system manually. Valid values are 'kqueue', 'pollset', 'epoll', 'devpoll', 'poll', 'select', or 'auto'. [default=auto]])])
if test "x$with_poller" == "x"; then
pollers=auto
......@@ -901,7 +917,7 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
fi
if test "$pollers" == "auto"; then
# We search for pollers in this order
pollers="kqueue epoll devpoll poll select"
pollers="kqueue pollset epoll devpoll poll select"
fi
# try to find suitable polling system. the order of testing is:
......@@ -916,6 +932,13 @@ AC_DEFUN([LIBZMQ_CHECK_POLLER], [{
poller_found=1
])
;;
pollset)
LIBZMQ_CHECK_POLLER_POLLSET([
AC_MSG_NOTICE([Using 'pollset' polling system])
AC_DEFINE(ZMQ_USE_POLLSET, 1, [Use 'pollset' polling system])
poller_found=1
])
;;
epoll)
LIBZMQ_CHECK_POLLER_EPOLL([
AC_MSG_NOTICE([Using 'epoll' polling system])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment