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

Re: [MiNT] USERDEF stack size



Am 23.12.2010, 14:04 Uhr, schrieb <arnaud.bercegeay@free.fr>:

Hi list,

I understand that there are a lot of questions about multi-threading, but if we focus back to gemlib, well... gemlib contains VDI bindings, and VDI is not *only* intended to manage the main UI of a GEM application.

VDI may be used to print something to a printer, and that makes sense that such stuff could be done in another thread. VDI may be used to build bitmap (virtual screen) in another thread, and then, the main UI thread may use the result (the bitmap) to display on the screen.

To sum-up, it appears that both work-around discussed here (malloc() and global "static" array of data) are bad idea if applied to gemlib.

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.

--
Helmut Karlowski