Geeks With Blogs
Jeff Krebsbach September 2010 Entries
Windows Impersonation and COM Behavior problems
In a ASP.Net web app I have a button that says "Process". It will spawn a new worker thread that will look at a network share and process some Excel files that have been produced by a third party system. To access the share and to use the Excel COM interop, I am impersonating an elevated user account different than the authenticated user, using Windows Impersonation. I then generate an Excel COM object for each Excel file, and process the files available in the network share. Today I noticed that ......

Posted On Thursday, September 9, 2010 6:50 PM

A better way for service threads
Every time I inherit a windows service, I see the same design pattern: public void ServiceProcess() { while (true) { Foo(); Thread.Sleep(300000); } } The theory here is that we are processing a work queue which will receive items, and every five minutes we will check to see what work has arrived in the queue. Do work, sleep five minutes, Do work, repeat. The problem is that we are blocking the owning process thread for five minutes while we sleep. If there is a request to stop the work thread while ......

Posted On Wednesday, September 8, 2010 6:58 PM

Copyright © jkrebsbach | Powered by: GeeksWithBlogs.net | Join free