The Unidata Local Data Manager (LDM) system includes network client and server programs designed for event-driven data distribution, and is the fundamental component of the Unidata Internet Data Distribution (IDD) system.
With the advent of the multicast feature, multiple threads are logging and it would be beneficial to support greping the messages for those from a particular thread as well as differentiating messages from different threads.
This can be done by invoking pthread_once() in ulog.c to create a THREAD_ID key, setting the value of the key to a mutex-protected, automatically-incremented integer, and then including the integral value in a message prefix (e.g., (file,line,thread-ID)).
Unfortunately, creating an elegant message prefix would seem to require modifications to both ulog.c and log.c: either ulog.c would have to know about incoming messages from log.c or the messaging functions of ulog.c would have to become macros.
Could the PID be added to the tuple? E.g., (PID,TID,file,line). This would break backward compatibility in terms of message format.
With the advent of the multicast feature, multiple threads are logging and it would be beneficial to support
grep
ing the messages for those from a particular thread as well as differentiating messages from different threads.This can be done by invoking
pthread_once()
inulog.c
to create aTHREAD_ID
key, setting the value of the key to a mutex-protected, automatically-incremented integer, and then including the integral value in a message prefix (e.g.,(file,line,thread-ID)
).Unfortunately, creating an elegant message prefix would seem to require modifications to both
ulog.c
andlog.c
: eitherulog.c
would have to know about incoming messages fromlog.c
or the messaging functions ofulog.c
would have to become macros.Could the PID be added to the tuple? E.g., (PID,TID,file,line). This would break backward compatibility in terms of message format.