[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [MiNT] Incorporating other calls into the



> -----Original Message-----
> From:	Guido Flohr [SMTP:gufl0000@stud.uni-sb.de]
> Sent:	Tuesday, June 29, 1999 10:25 AM
> To:	MiNT mailing list
> Subject:	Re: [MiNT] Incorporating other calls into the
> 
> On Mon, Jun 28, 1999 at 03:58:09PM +0100, Jo-Even.Skarstein@gjensidige.no
> wrote:
> > Also, what's the state of the current MiNTlib re. reentrancy?
> 
> What do I have to do to avoid reentrancy problems with the SLB loader?
> 
I really don't have much experience with SLB's (I've only written a very
small GEM-library for testing purposes), but what I did was to allocate the
global data in the calling application and pass a pointer to it when calling
the library. I guess something like this could be done with MiNTlibs as
well, by keeping the global datastructures in a stub linked with the
application. The startup-code would then allocate memory and call the SLB's
init-function automatically.

One major problem with this (crude) scheme is that you'll have to make the
stub reentrant as well if you want the library to be thread-safe... But
writing multithreaded GEM-apps is a PITA anyway, so I doubt this makes much
of a difference.

Jo Even Skarstein