Welcome! Log In Create A New Profile

Advanced

Threads, GX and IOSReloading

Posted by arasium 
Threads, GX and IOSReloading
March 01, 2011 03:31PM
Hi,

some time ago, i've started to develop an "event oriented ui framework". I mean that this framework will work like some framework used in Java or .NET (so, no real time like yyou can found in libwiigui).

So, i've a UI thread that manage the ui message queue and the ui is thread safe (if the command doesn't comes from the ui thread, we put a message to the queue and then it will be executed by the ui thread).

All is ok, except when i tried to reload the IOS (for a syscheck gui). I've a code dump but not every times.

So my question is:
- Can i call LWP api while the ios is reloading?
- Can i call the GX api when the ios is reloading?
- Does the iosreloading destroy something from LWP managmeent (thread pools or something else)?
- Does the iosreloading destroy something from the GX configuration ?

Thx



Edited 1 time(s). Last edit at 03/01/2011 03:35PM by arasium.
Re: Threads, GX and IOSReloading
March 02, 2011 12:28AM
you brought up libwiigui - have you looked into how it works? there is 1 thread which is constantly looping which does all the GX commands and draws on the screen. you can reload IOS as much as you want in your other threads. there is even a libwiigui based syscheck type tool on wiibrew.

I think this shows you that the GX and LWP APis both work fine and can be called during the IOS reload.
Re: Threads, GX and IOSReloading
March 02, 2011 06:39AM
All your other threads will (or at least should) be paused while IOS is being reloaded. LibOGC already takes care of this for you (in theory).
Since loading a new IOS trashes a large portion of MEM2 it has the potential to destroy either of the things you mentioned, depending on where they are located. Also depending on how much memory your program has allocated from the heap, it could trash a lot of other stuff. This is why you should only do it once at the beginning (or maybe end) of your program and not in the middle of running, and why apps like syscheck are made of fail.
Re: Threads, GX and IOSReloading
March 03, 2011 10:20AM
Quote
giantpune
you brought up libwiigui - have you looked into how it works? there is 1 thread which is constantly looping which does all the GX commands and draws on the screen. you can reload IOS as much as you want in your other threads. there is even a libwiigui based syscheck type tool on wiibrew.

I think this shows you that the GX and LWP APis both work fine and can be called during the IOS reload.

Thank you but i know exactly how ui frameworks are working and i think libwiigui is a vey good framework but a lot of things are missing (ie BackgroundWorker componant, UI Events like CursorEnter, CursorLeave, Click on wich you can atytach listeners)... This is my job IRL so the problem doesn't comes from my understanding of the UI layer. And what you say doen't show anything. IOSReloading works very well with my framework if i do it in the UI thread (wich is the main thread). I only have a code dump if i ask to reload the IOS in an other thread (and not on every tests, sometimes it works).


@tueidj: Thank you for these informations. But i think that my problems doesn't comes from a mem2 violation. I've done these tests:
1 - Original: run the reloading in a background task (ie a thread) with the full UI => CRASH
2 - WO thread: run the iosreloading without any other thread than the ui thread (i manage the background job by doing it steps by steps on each redraw to avoid "io freeze") => OK
3 - Minimalist: Remove all the UI componant (only one button left on the screen) and iosreloading in background => CRASH

So the third test doesn't use a lot of memory (the second test use 10x more memory) and it crash..... I will look into the thread synchronisation to check if the main thread is blocked or not during the reload.
By the way, i'm using the libogc 1.8.3 (the new ones crash my application very often)



Edited 1 time(s). Last edit at 03/03/2011 10:21AM by arasium.
Re: Threads, GX and IOSReloading
March 05, 2011 09:30PM
If newer libogc revisions crash your application, you have some sort of issue in your code, somewhere. The latest libogc is stable.
Re: Threads, GX and IOSReloading
March 08, 2011 02:21PM
I haven't test the latest one because of all the bugs i had with 1.8.4 and 5.

I will test. Thank you for this info
Sorry, only registered users may post in this forum.

Click here to login