Date: Thu, 14 Jan 1999 18:49:28 +1000 From: Greg Black <gjb@acm.org> To: "Mehta, Hiren" <Hiren.Mehta@VLSI.com> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: reentrant code Message-ID: <19990114084929.5032.qmail@alice.gba.oz.au> In-Reply-To: <B7296B02BA8ED111A610006008A33549019626E6@sjc-magnesium> of Wed, 13 Jan 1999 13:27:10 PST References: <B7296B02BA8ED111A610006008A33549019626E6@sjc-magnesium>
next in thread | previous in thread | raw e-mail | index | archive | help
> This question is not specific to Freebsd. It is a very general question. So it probably doesn't belong here ... > What is the meaning of reentrant function ? I'll use C terminology here. A function that accesses a static object is not re-entrant. A function that calls a function that accesses a static object is not re-entrant. And so on. > What do I do to make a function reentrant ? Don't use static objects. Only call functions that are themselves re-entrant. This second one is difficult, because documentation often lies about this -- to be sure, you have to read the source :-( And don't write to addresses handed in by callers, because this is the same as accessing static objects. In other words, it's harder than it looks to get it right. -- Greg Black <gjb@acm.org> To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990114084929.5032.qmail>