Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm Sender: cygwin-apps-owner AT cygwin DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps AT cygwin DOT com Delivered-To: mailing list cygwin-apps AT cygwin DOT com content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: setup.exe exception handling guidelines Date: Tue, 30 Apr 2002 21:09:48 +1000 X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Robert Collins" To: "CygWin Apps" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g3UBAAY12322 I've reviewed the use of threads, and I believe the following guidelines will provide safe exception handling without stomping across threads. Exception handling guidelines: For 100% message based windows, exceptions in code will get caught by the same thread that handles window messages - which means the propertysheet thread. The catch routine here can only catch exceptions within a message. for thread based windows (i.e. site, or the current chooser, or download), the thread reflector can catch() whatever it wants to... AS LONG AS the window message routine does not do any exception processing (ie , try catch or throw). What does this mean? Well things like the nio code can throw an authentication exception, to separate out the functional code and the UI. This will let Pavel Tsekov's URL class get added to setup in the near future, and will also allow some more cleanups leading up to a command line version and or more split out support libraries. Of course, if the gcc library (mingw or cygwin) was built with --with-threads, this would be simpler. Exceptions that can be thrown: I'm going to create a base Exception class, from which all thrown exceptions should derive. No char/string or String exceptions are allowed. This allows a generic catch-all Exception handler, and by subclassing, more specific handlers can sit in front of it. Cheers, Rob