rlwatson

ServerLogger - Multi-threading

Discussion created by rlwatson on Mar 4, 2013
Latest reply on Mar 9, 2013 by rlwatson
I have a Server Object Extension which uses threads from the thread pool.  Threads from the thread pool are, by definition, COM MTA.  When I try to log messages from an MTA thread then I find that I get various exceptions related to the RCW.  I know that ArcObjects are COM STA and that they do not deal well with MTA threads.

Just wondering if anyone has an suggestions, other than not using the thread pool, here?  What I've done is to wrap the ServerLogger in a class which simply does not log messages unless the request comes from thread that created the class, i.e. the main thread.  This stop the crashes but also causes me to lose valuable messages.

What I really wish is that the ServerLogger was able to support MTA threads.  I am not asking for all ArcObjects (that is not going to happen) but rather just the logging system.

Outcomes