Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
GeneralRe: TextureBrush problem Pin
Xmen Real 10-Jun-10 4:31
professional Xmen Real 10-Jun-10 4:31 
QuestionError in printing Pin
future38399-Jun-10 13:45
future38399-Jun-10 13:45 
AnswerRe: Error in printing Pin
Luc Pattyn9-Jun-10 14:04
sitebuilderLuc Pattyn9-Jun-10 14:04 
GeneralRe: Error in printing Pin
future38399-Jun-10 14:20
future38399-Jun-10 14:20 
GeneralRe: Error in printing Pin
Luc Pattyn9-Jun-10 14:36
sitebuilderLuc Pattyn9-Jun-10 14:36 
QuestionExceptions From Threads Pin
JohnLBevan9-Jun-10 12:03
professionalJohnLBevan9-Jun-10 12:03 
AnswerRe: Exceptions From Threads Pin
Luc Pattyn9-Jun-10 12:52
sitebuilderLuc Pattyn9-Jun-10 12:52 
GeneralRe: Exceptions From Threads Pin
JohnLBevan10-Jun-10 1:52
professionalJohnLBevan10-Jun-10 1:52 
Thanks for the info about the BackgroundWorker; I hadn't used that before. I had a play, and that works well for running threads and catching exceptions, but as I needed to trigger it from a timer, the issue of bubbling exceptions up past the timer remained. When I tried using the worker's completed event, to retrigger it, this caused a new asynchronous thread to be created, which worried me about the potential for memory leaks and stack overflows; these may not be an issue, but my knowledge isn't good enough to feel comfortable with this yet.

However, I realised that I'd missed an obvious solution. The actual issue I was trying to solve is this:
I have a windows service, which starts a number of threads to poll different resources at various intervals (e.g. one thread monitors a folder on the file system every 30 seconds, another queries a database every hour). These threads are to run in parallel, and also run the handling code for where results are found (ceasing to poll whilst the handler code runs to avoid overloading it). Should an exception occurs in one of these threads, I wanted to ensure that it was reported to the eventlog, so put a try catch around the service call, hoping for it to catch all exceptions.

My solution was to simply change from using a top level exception handler to using a singleton exception handler available to all threads. Each thread then had the standard exception bucket around all of its contents, allowing exceptions to be reported correctly. As I say, this is a solution to a different problem to the one I initially posted, but hopefully this'll help others with similar issues.

Thanks again to Luc for all your assistance.

JB
QuestionThreads, Static Fields & Abstract Classes Problem Pin
JohnLBevan9-Jun-10 11:53
professionalJohnLBevan9-Jun-10 11:53 
AnswerRe: Threads, Static Fields & Abstract Classes Problem Pin
Luc Pattyn9-Jun-10 12:43
sitebuilderLuc Pattyn9-Jun-10 12:43 
GeneralRe: Threads, Static Fields & Abstract Classes Problem Pin
JohnLBevan10-Jun-10 0:55
professionalJohnLBevan10-Jun-10 0:55 
GeneralRe: Threads, Static Fields & Abstract Classes Problem Pin
Luc Pattyn10-Jun-10 1:05
sitebuilderLuc Pattyn10-Jun-10 1:05 
Questionmaking auto serial number for each build of project Pin
kasraa000980009-Jun-10 9:47
kasraa000980009-Jun-10 9:47 
AnswerRe: making auto serial number for each build of project Pin
#realJSOP9-Jun-10 10:02
mve#realJSOP9-Jun-10 10:02 
GeneralRe: making auto serial number for each build of project Pin
Jason Vetter9-Jun-10 10:11
Jason Vetter9-Jun-10 10:11 
GeneralRe: making auto serial number for each build of project Pin
#realJSOP9-Jun-10 23:45
mve#realJSOP9-Jun-10 23:45 
AnswerRe: making auto serial number for each build of project Pin
Tony Richards9-Jun-10 10:44
Tony Richards9-Jun-10 10:44 
QuestionHow to build reportviewer using existing dynamic dataset without report wizard Pin
roman_s9-Jun-10 8:24
roman_s9-Jun-10 8:24 
QuestionFor Multilingual Application Pin
Andy Rama9-Jun-10 7:59
Andy Rama9-Jun-10 7:59 
AnswerRe: For Multilingual Application Pin
Dimitri Witkowski9-Jun-10 8:50
Dimitri Witkowski9-Jun-10 8:50 
QuestionRe: For Multilingual Application Pin
Andy Rama10-Jun-10 6:07
Andy Rama10-Jun-10 6:07 
AnswerRe: For Multilingual Application Pin
Dimitri Witkowski10-Jun-10 6:16
Dimitri Witkowski10-Jun-10 6:16 
GeneralRe: For Multilingual Application Pin
Andy Rama10-Jun-10 6:18
Andy Rama10-Jun-10 6:18 
QuestionHow to return a collection from a method. Pin
Chiman19-Jun-10 6:28
Chiman19-Jun-10 6:28 
AnswerRe: How to return a collection from a method. Pin
Luc Pattyn9-Jun-10 6:50
sitebuilderLuc Pattyn9-Jun-10 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.