Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!awdprime!longhorn.austin.ibm.com!jason From: jason@longhorn.austin.ibm.com (Jason Lowdermilk) Newsgroups: comp.sys.amiga.programmer Subject: Re: Need help accessing MathTrans library from Task Message-ID: <5847@awdprime.UUCP> Date: 12 Mar 91 17:23:47 GMT References: <5778@awdprime.UUCP> <29024.27db9dce@kuhub.cc.ukans.edu> Sender: news@awdprime.UUCP Distribution: na Organization: IBM AWD, Austin Lines: 30 In article <29024.27db9dce@kuhub.cc.ukans.edu> markv@kuhub.cc.ukans.edu writes: >> I'm having a problem accessing the transcendental math library from a >> "child task" created with CreateTask, in particular the sqrt function. > >A task can call MathTrans library. It cannot always call >OpenLibrary("mathtrans.library",34L); because if the library is not in >memory, then Exec will call LoadSeg() to get the library in memory, >which is guarenteed to be a one way trip to la-la land if it isn't a process. > >So, the parent of the child needs to OpenLibrary() so that the library >is in memory. Then the child can get the base from the parent >(easy to do if child is a function in the parent and they share global >data), otherwise the child can call OpenLibrary() as long as the >parent holds mathtrans.library open to keep it in memory. > The parent process opens the mathtrans library prior to creating the child. The parent also calls sqrt() several times before creating the child. Sqrt is the the only transcendental function I am using, although I can duplicate the problem by calling some other function such as sin(). I have worked around this problem by writing my own sqrt routine as a function (in fact it is several times faster than the system sqrt, albeit less accurate), but I am still curious why this doesn't work. I can put together a minimal code example that illustrates this and post it tomorrow. -- Jason Lowdermilk internet: jason@longhorn.austin.ibm.com UUCP: @cs.utexas.edu:ibmchs!auschs!longhorn.austin.ibm.com!jason VNET: LOWDERMI@DALVM41B