Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

ParallelForwardingAppender do not mix Task and Threads #39

Open
xmedeko opened this issue Feb 5, 2018 · 0 comments
Open

ParallelForwardingAppender do not mix Task and Threads #39

xmedeko opened this issue Feb 5, 2018 · 0 comments

Comments

@xmedeko
Copy link

xmedeko commented Feb 5, 2018

Current implementation of ParallelForwardingAppender is wrong, since it block a thread form the default ThreadPool. The C# Tasks and Threads should not be mixed together. {{BlockingCollection}} is based on a thread synchronization (lock), so do not use it for the Task running on a ThreadPool.

The Task based producer - consumer is a bit more complicated, e.g. see Stephen Clearys's or .NET doc). Anyway, do not use tasks, since the ForwardLoggingEvent is not Task-based. (E.g. some appender sending logs by network may have long log times.) Just start a new plain thread.

See also #37

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant