From: Brian P. <br...@tu...> - 2003-03-27 20:16:33
|
Keith Whitwell wrote: > Karl Rasche wrote: > >>> closely. It seems to be implied that each time a spu is added to a >>> chain, a shared object is dlopen'ed, and that if you added the same >>> spu twice, this would cause a failure? >> >> >> >>> I don't understand why you'd ever need to load the same .so file >>> twice, unless you were relying on using static variables to store >>> state. In which case, the >> >> >> >> Not a failure per say, but the second spus config would clobber the >> first, >> as, you correctly deduce, that the config state is static. >> >>> easiest answer would be to switch to malloc'ed state variables. >>> Loading the >> >> >> >> Wouldn't you then have to 'keep track' of the malloced state someplace, >> and which state goes with which instance, and get it back into the spu >> when entering a function? > > > Yep, but you'd have to do something like this for threading support too, > wouldn't you? > > Fast TLS is a GL prerequisite, it seems. The problem isn't just threading. Suppose you have two instances of the same "foobar" SPU in your SPU chain. When you're in the foobarspu_Enable() function, how do you know which instance of SPU state to grab? -Brian |