En/na Mattias Gärtner ha escrit:
I'm writing a unit to simplify parallel methods/procedures.

For example:
  DoParallel(@AMethod,StartIndex,EndIndex,Data);

The AMethod is executed with several threads in parallel.

What should happen when an exception occurs?

AFAIK any unhandled exception in a thread will cause it to silently die

It would be nice if the exception can be transfered to the main thread.
Is this possible? How?

I don't know, set a flag in the thread and check it periodically from the main thread? (Florian's suggestion does the reverse: raise in a thread an exception occurred while executing in the context of the main thread)

Bye
--
Luca
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to