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

Re: [MiNT] USERDEF stack size



On Thu, 2010-12-23 at 17:49 +0100, Helmut Karlowski wrote:
> Another idea from me: :-)
> 
> Use a separate stack for the VDI-arrays:
> 
> 
> then in the function:
> 
> vdif()
> {
> 	short *intin;
> 	static short s_intin[16][2048];
> 	static int cnt = -1;
> 	cnt++;
> 	intin = s_inin[cnt];
> 
> 	call_vdi();
> 
> 	cnt--;
> }
> 
> So here 16 threads would be able to use this function simultaneously.

You would need a lock too, which makes the stack superfluous. But I
think you're making it too complicated. Making the parameter arrays
local to the process/thread is easy, simple and also proven. Take a look
at Andreas Kromke's mt_gem-lib to see how easy it can be done. It's also
100% compatible with TOS and MagiC.

Jo Even