[fpc-devel] Exceptions in threads
Mattias Gärtner
nc-gaertnma at netcologne.de
Thu Dec 11 16:56:58 CET 2008
Zitat von Vincent Snijders <vsnijders at vodafonevast.nl>:
> Florian Klaempfl schreef:
> > Mattias Gärtner schrieb:
> >> Zitat von Michael Van Canneyt <michael at freepascal.org>:
> >>
> >>> [...]
> >>> This is the problem: At which point should this be done ?
> >>>
> >>> Can you point at the statement where it should be raised in the following
> >>> code:
> >>>
> >>> try
> >>> ...
> >>> DoParallel(...);
> >>> ...
> >>> except
> >>> end;
> >>>
> >>> There is only 1 possible location: in a waitloop which should be after
> the
> >>> DoParralel. This loop must check for the exceptions...
> >> Not after, but at the end of DoParallel.
> >
> > What happens if more threads throw an exception?
They are ignored.
If you want to handle more than the first exception then you can put a
try..except into AMethod.
Note: The thread pool should simplify some parallelizations. It does not solve
the problems of multi threading.
> A new exception is thrown, which has a List of InnerExceptions, instead
> of just a single InnerException ;-)
... and a tree is created for recursive DoParallel calls. ;)
Mattias
More information about the fpc-devel
mailing list