Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!uunet!olivea!oliveb!amiga!boing!dale From: dale@boing.UUCP (Dale Luck) Newsgroups: comp.sys.amiga.programmer Subject: Re: Need help accessing MathTrans library from Task Message-ID: <955@boing.UUCP> Date: 12 Mar 91 14:45:41 GMT References: <5778@awdprime.UUCP> <1991Mar11.202919.21272@msuinfo.cl.msu.edu> Reply-To: dale@boing.UUCP (Dale Luck) Distribution: na Organization: Boing, Milpitas, Ca. Lines: 36 In article <1991Mar11.202919.21272@msuinfo.cl.msu.edu> jap@convex.cl.msu.edu (Joe Porkka) writes: >jason@longhorn.austin.ibm.com (Jason Lowdermilk) writes: > >>I'm having a problem accessing the transcendental math library from a >>"child task" created with CreateTask, in particular the sqrt function. > >The only gotcha would be that OpenLibrary() requires you to >be a process, so unless your main process does the >OpenLibrary for the child task, you have the potential to >go BOOM. > I think you could get around this by calling OpenLibrary of mathtrans in the process that starts the task before starting the task that needs the sqrt function. The first thing the new task should do though is another OpenLibrary of mathtrans also for it's own use. The first OpenLibrary will guarentee the library is loaded and running and therefore the other task(nonprocess) will not need to worry about OpenLibrary running off to do some DOS stuff. I don't know if this action is guarenteed or spelled out, but it seems logical to me. Would be nice if OpenLibrary would actually use another process to do that work though instead of the current tasks context, thereby making OpenLibrary a safe task only function. A point to be made: Each task must call OpenLibrary when using the math libraries. It is illegal to for a new task to use the context of another task when using the math libraries. The reason: Floating point chips need to maintain per task context. They are initialized for the current task only when OpenLibrary is called. -- Dale Luck GfxBase/Boing, Inc. {uunet!cbmvax|pyramid}!amiga!boing!dale