[Lazarus] thread safe
Mattias Gaertner
nc-gaertnma at netcologne.de
Mon Jun 27 17:21:12 CEST 2011
Hans-Peter Diettrich <DrDiettrich1 at aol.com> hat am 27. Juni 2011 um 16:58
geschrieben:
> Martin schrieb:
>
> > See my example about memory alloc in my other mail. It shows, that a
> > piece of code (and it's ability to be "safely invoked ") does not solely
> > depend on the parameters passed, but also on (selected parts of) the
> > state of the application or system.
>
> What when some code does not return anything, *and* cannot work at all
> due to some problem (out-of-memory, file deleted, object destroyed...)?
>
> When e.g. a file search cannot proceed due to missing access rights? It
> cannot return an boolean value (succ/fail), because it's simply unknown
> whether the file exists.
>
> When in case of an unexpected error the called procedure throws an
> exception? Can this procedure *ever* be "safely invoked", when it may
> return to some other place in code (exception handler)?
Yes, if raising an IO exception is a valid output.
Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110627/b5b667ba/attachment-0003.html>
More information about the Lazarus
mailing list