Fork() or dol

support for the powerpc toolchain
Post Reply
jenergy
Posts: 2
Joined: Sun Apr 11, 2010 5:52 pm

Fork() or dol

Post by jenergy » Sun Apr 11, 2010 6:13 pm

Hi everyone!
Just a little question.
I've got sources for a c-program standalone for wii, and I need to 'launch' it from another 'logical' program (with sources) several times, a kind of front-end for the first program. Perhaps there are these ways:

1) Merge two programs into one by renaming the 'main' function of the standalone program, and call it in the front-end simply by calling the function renamed when needed.
The problem is that there are some global variables and allocated memory which make impossible to load it several times: for example, there are some checks on global hash tables, at the second call hash table is full and this is a logical error..or, some initializations fail because resources has been already initialized the first time. The standalone is too complex to quickly understand how to reset ALL.
Is there a way (general c or wii) to 'reset' ALL memory/variables allocated?
I tried to use the fork() (that was the best solution for me!!) but it fails on wii!!
I think that wait and pipe won't run on wii too..

2) Launch standalone program dol from the frontend dol
Is it possible? Since I've got sources of both, what do you suggests?

Someone can help me?

Thank you anyway!!

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests