• Similar to the fixes for subscriber, without holding the waiter_lock_,
    updating the waiting_done_ flag may cause deadlock. In the deadlock
    example below, Thread1 is waiting for the response, thread 2 is
    processing the response and updating the waiter_lock_ variable:
    
    ----------------------------------------------------
    |        Thread 1          |       Thread 2        |
    ----------------------------------------------------
    | locks 'waiter_lock_'     |                       |
    | check 'waiting_done_'    |                       |
    |                          | Update 'waiting done' |
    |                          | Send notification     |
    | begin waiting for signal |                       |
    | *deadlocked*             |                       |
    ----------------------------------------------------
    Collin Hockey authored
     
    Browse Dir »
  • The lock used with the condition variable should always be the same one
    guarding changes to the condition itself, in these cases, the lock
    guarding changes to the subscribe and psubscibe data structures.
    
    This commit also limits the number of locks held by the subscribeBase
    function at any one time.
    Collin Hockey authored
     
    Browse Dir »






  • User can now enable no-wait mode, which chooses whether we use the
    EVRUN_NOWAIT flag in ev_run. The default is off, so that we don't
    use 100% CPU. Note added in tutorial to enable when performance
    is critical. Added to the speed test examples.
    
    Bump to 0.2.1. Remove patch number from HISTORY entry - that's what the
    git log is for. Make note on minor release.
    Hayk Martirosyan authored
     
    Browse Dir »





  • Split up command into command, command_blocking, and command_looping.
    The original command no longer returns anything, which clarifies how it
    should be used in most cases. command_looping and command_blocking both
    return a command object.
    
    Also added a waiting CV to the Command object, though it is not used in
    command_blocking yet.
    Hayk Martirosyan authored
     
    Browse Dir »
  • Now, there is only one callback for command(), and it returns a const
    reference to the Command object. The user is responsible for error
    checking using c.ok(), c.status(), and getting the reply with c.reply().
    This significantly cleans up the library code and the user code.
    
    Greatly refactored the data type specialization code in command.cpp.
    Hayk Martirosyan authored
     
    Browse Dir »



  • utils/logger.[ch]pp gives a logger implementation based on ostringstream
    that is pretty nice. I took this from Stack Overflow and added some
    things to make syntax nicer. Changed all cout and cerr statements in
    Redox to be of the form logger.{debug/info/warning/error/fatal}() <<
    stuff. Arguments for non-printed statements are still evaluated. Gives a
    performance hit if we actually add statements on every callback and run
    speed tests. For most use cases, doesn't matter. For now, not including
    such low level output anyway. Would be nice to have a macro to leave
    out/include the low-level logs at compile-time.
    Hayk Martirosyan authored
     
    Browse Dir »