Opened 12 years ago
Closed 12 years ago
#2076 closed task (invalid)
mg-desktop: Make logging single-threaded
Reported by: | jng | Owned by: | jng |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | Desktop API | Version: | |
Severity: | trivial | Keywords: | |
Cc: | External ID: |
Description
The logging facilities which we grafted from the MapGuide Server codebase operates on a background thread. Logger calls actually queue up log requests to the background logger thread.
This design is great for a server-based application, but is problematic for desktop applications as the logger thread may cause access violations on application exit, even though we've instructed the logger thread to stop. Any access violations on an exit of an mg-desktop application is due to this particular problem.
This problem should be work-aroundable by making the logging single-threaded. That is: logger calls write the message to the file directly instead of being queued up for writing to the file by the logger thread. This way, there is no un-wieldy logger thread to deal with upon the call to MgPlatform.Terminate()
For desktop applications, such overhead of not queuing logger calls to a background thread should be negligible.
It's happening with the single-threaded logging as well. Scratch this as the culprit