• antirez's avatar
    Threaded IO: logging should be safe in I/O threads. · 463ccf86
    antirez authored
    Potentially it is possible that we get interleaved writes, even if
    serverLog() makes sure to write into a buffer and then use printf(), so
    even this should be ok. However in general POSIX guarantees that writing
    to the same file pointer object from multiple threads is safe. Anyway
    currently we *reopen* the file at each call, but for the standard output
    logging.
    
    The logging functions actually also access global configuration while
    performing the log (for instance in order to check the log level, the
    log filename and so forth), however dunring the I/O threads execution
    we cannot alter such shared state in any way.
    463ccf86
networking.c 104 KB