-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #131: handle log msgs thread safe using a queue
Multiple threads can log at the same time. By default Python's logging system uses a lock to protect the shared resources for each handler. But this may generate a lot of contention on the lock if there are a lot of messages to be handled. More over the handling of the message writes it to disk/console which it is slow. Instead a QueueHandler is used to receive the messages and pass them to the QueueListener using a thread-safe queue. The listener sends the messages to the original handler (XStreamHandler) in background without blocking the rest of the threads.
- Loading branch information
Showing
2 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters