Select to view content in your preferred language

ServerLogger - Multi-threading

2137
10
03-04-2013 04:53 AM
RichardWatson
Deactivated User
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.
Tags (2)
0 Kudos
10 Replies
RichardWatson
Deactivated User
I have also seen similar errors which regards to clearing the log on a site with a single machine.  Next week, I am hoping to do some testing with a site that has multiple machines.

I filed a NIMBUS on the time stamp issue.  ESRI just needs to implement a stable sort algorithm to solve this.

I think that there are a lot of users who just use ArcObjects from their web service and avoid using ArcGIS Server at all.  You see it all the time in the forums posts because many struggle with binding and licensing in this situation.  The various design choices are about trade-offs.  For example, if you use ArcObjects directly then you gain simplicity but you lose scalability.  I suspect that you someone has a list with the all the trade-offs.
0 Kudos