• Interesting ACE_Reactor cpu usage observation

    From technog1@21:1/5 to All on Fri Mar 17 15:14:40 2017
    Issue with the reactor based server killing the cpu, even when not processing any information.

    ACE VERSION: 6.3.4

    HOST MACHINE and OPERATING SYSTEM:

    OS: Fedora 25
    Linux: 4.9.12-200.fc25.x86_64



    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
    COMPILER NAME AND VERSION (AND PATCHLEVEL):

    THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
    specific file, simply state which one]:
    g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)

    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
    use a link to a platform-specific file, simply state which one
    (unless this isn't used in this case, e.g., with Microsoft Visual
    C++)]:
    include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

    #INSTALL_PREFIX = /usr/local/lib
    INSTALL_PREFIX = /home/3plibs/ACE-6.3.4


    CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
    (used by MPC when you generate your own makefiles):

    AREA/CLASS/EXAMPLE AFFECTED:
    [What example failed? What module failed to compile?]

    DOES THE PROBLEM AFFECT:
    COMPILATION?
    LINKING?
    On Unix systems, did you run make realclean first?
    EXECUTION?
    OTHER (please specify)?
    [Please indicate whether ACE, your application, or both are affected.] Application is affected

    SYNOPSIS:
    ACE Reactor simple server is killing cpu @ 100% even when not doing anything. Using the ACE Reactor example code from apg.

    DESCRIPTION:
    Was having an issue with my server, so decided to build an old example of the ace_reactor code. Its a simple echo server, exactly like the example in apg.
    So i have the Acceptor and Svc_Handler based classes and objects.

    When i run this simple echo server, and its not doing anything, all seems to be good, and its not killing the cpu.

    I connect to the server via a client and send it small 1 word messages.
    The ace reactor server kills the cpu at 100%.
    Even after the client disconnects and exits, the reactor server is pegging the cpu at 100% !!!! When it really should be doing nothing at all.
    I have to kill the server.


    Sys tracing the executable gives me these lines in a very tight loop, when in idle state.

    ...

    strace: Process 16362 attached
    rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    select(7, [3 5], [6], NULL, NULL) = 1 (out [6])
    rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
    select(7, [3 5], [6], NULL, NULL) = 1 (out [6])
    rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
    rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0

    ...


    I dont think i have seen this issue before with the reactor based server, or at least not noticed it. But i really doubt this existed before.
    Looking for some suggestions please, as the real server based on the reactor gets killed as well, when it should be idle.



    REPEAT BY:
    [What you did to get the error; include test program or session
    transcript if at all possible. ]

    SAMPLE FIX/WORKAROUND:
    [If available ]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)