You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/23 12:53:26 UTC

[GitHub] [incubator-nuttx] fjpanag edited a comment on issue #3599: Syslog thread-safety

fjpanag edited a comment on issue #3599:
URL: https://github.com/apache/incubator-nuttx/issues/3599#issuecomment-825637409


   > I think the way to go would be to always use an interrupt buffer and use a work queue for logging to "slow channels".
   
   This is indeed one approach, as mentioned in the original post.
   
   But I am opposed to this, for 3 reasons:
   
   1. I am of the strong opinion that the logger should be synchronous. It is a great debugging tool, so you must be able to see what is happening, the moment it is happening. Neither at a later time, nor at a different order. Exactly as the code generated it.  
   
   2. Having the logger use a worker thread is not a good idea IMO. It makes the system unpredictable, and affects the real-time behavior. It makes it impossible to tell when the actual access to the device will take place, or when this "heavier" processing will utilize the CPU. A channel driver may lock other resources at an undetermined moment in the future, that affect higher priority threads that need the same resource. If `syslog()` writes directly to the device, then you know that "**now** the system has a slow job to do", and design it accordingly.
   
   3. The syslog will always be used in almost all systems. Lightweight applications though, may not need a worker thread. If the logger requires it, then you force everyone to use a new thread that otherwise may not. And this needs resources that a small system may not be able to spare. Effectively it increases the minimum system footprint for NuttX.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org