[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming

quick output and slow log

Krzysztof Zelechowski

10/5/2014 6:16:00 PM

Hello,

I have a situation when an application writes to output and to log. The
log device is slow and blocks the application from moving on with the
output. The net result is that the application fails (times out)
because it takes too long to log messages, which is unwanted because
logging is meant to be a side effect only. The logged messages usually
appear in batches.

Please advise how to solve the problem so that all logged messages
eventually appear in the log.

Thanks,
Chris
1 Answer

Dmitry A. Kazakov

10/5/2014 6:49:00 PM

0

On Sun, 05 Oct 2014 20:16:10 +0200, Krzysztof ?elechowski wrote:

> I have a situation when an application writes to output and to log. The
> log device is slow and blocks the application from moving on with the
> output. The net result is that the application fails (times out)
> because it takes too long to log messages, which is unwanted because
> logging is meant to be a side effect only. The logged messages usually
> appear in batches.
>
> Please advise how to solve the problem so that all logged messages
> eventually appear in the log.

Assuming it is only the latencies which are worrying you, because if the
device cannot handle the amount of data, you cannot do anything.

The technique is that you queue log messages to the logger task. The logger
task performs actual output. This also solves the problem of interleaving
messages when output from concurrent tasks.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-...