Hi,
I'm developing a new module that writes logs in a log file using the function fprintf. My question is, do I have to implement any lock to write safely in the file? As far as I know fprintf is thread-safe, but even though it, I don't know if it is necessary or not.
Thanks,
Laura
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/681
You need to synchronise when writing to same file from many processes. Among options:
* 1) lock a mutex; open file; append message; close file; unlock mutex * 2) each process writes to pipe and a dedicated process reads from the pipe and writes to the file
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/681#issuecomment-227809239
I am closing this issue -- we use the tracker on github for bugs or new feature requests. If you want to discuss more on this topic, use the mailing lists (e.g., sr-users at lists dot sip-router dot org).
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/681#issuecomment-227959568
Closed #681.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/681#event-701450358
Thank you Daniel.
Laura García Pérez www.logslie.com http://www.logslie.com/ +34680923532 +12602069698
On 23 Jun 2016, at 08:15, Daniel-Constantin Mierla notifications@github.com wrote:
Closed #681 https://github.com/kamailio/kamailio/issues/681.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/681#event-701450358, or mute the thread https://github.com/notifications/unsubscribe/AEpXvX3BJa-b88fceCBev3CpvHCciIFvks5qOiR3gaJpZM4I7mj_.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/681#issuecomment-227962139