Thank you for submitting your inquiry.
You can track the status of your inquiry here.
You may want to save your case's ticket: 416782_1n7rsv4g9vrudomi


    (Open) When using the Threadpool, exceptions are silently caught
     
     
     
    3
    1) What happened
    When using the Threadpool, exceptions are silently caught. 

    This is very bad for application consistency/correctness/stability etc.  Standard .NET behaviour is to terminate the application when an unhandled threadpool exception occurs (http://msdn.microsoft.com/en-us/library/0ka9477y.aspx), but Unity3d soldiers on. 

    I spent a few days tracking down a bug in my code that was obfuscated by this silent catch behaviour.  I understand that it's not cool if Unity3d were to crash / terminate when a game is running, but at the very least, there should be a mechanism to draw attention to exceptions that occur in the threadpool, as many of them will put the application into an inconsistent/invalid state.  With appropriate exception handling, consistency can be maintained.

    Also, anyone from a .NET background will likely make assumptions about the threadpool's behaviour.

    2) How can we reproduce it using the example you attached
    I didn't attach an example, but it should be easy to reproduce.
    * Create a blank project
    * Create a mono behaviour of some sort
    * Dispatch some work to the threadpool via ThreadPool.QueueUserWorkItem(WaitCallback callback, object state) (http://msdn.microsoft.com/en-us/library/4yd16hza.aspx)
    * Somewhere in the WaitCallback method that runs on the threadpool, throw an exception
    * Confirm that no exception is reported in the editor
     
       
      Your Cases:
      Case Title Status Date Opened
      416782 When using the Threadpool, exceptions are silently caught Open 8/26/2011 6:08 PM
      392548 WWW.error evaluates to 'false' even when the response Open 2/21/2011 1:02 PM
      392009 I've been in touch with Mark Harkness at Unity about this Closed 2/16/2011 3:47 PM
      389045 Worked in visual studio for a bit, came back and unity Open 1/19/2011 6:25 PM