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

Re: JACE crashes fixed!!!



BLuRry wrote:
> The culprit this whole time was the evil nature of multithreaded code.  It
> is possible for events to trigger various soft switches, namely a few the
> might also cause the emulator to reconfigure the MMU memory map.
> 
> The toxic part about this is that there was no mutex around memory
> configuration, and because MMU has a lot of rules, the memory
configuration
> starts off with a base layer (aux or main mem) and then layers on the
> correct pages of Zero-page, language card, rom, etc.  This was implemented
> perfectly as far as I could tell.  And I was under the impression this was
> the problem, but I was only kind of right.
> 
> The real problem was that memory reconfiguration was occurring while the
> CPU thread was still running!  Because of this, there was a horrible race
> condition that was only manifesting in airheart when I was holding down
the
> closed-apple to go fast.  And apparently, in some cases when I was
pressing
> closed-apple in prince of persia to grab a ledge (I usually hold
open-apple
> a lot when playing POP).  All this combined: Race condition.  Solved.
> 
> I won't hold my breath and assume this fixed the random prodos desktop
> crashes, it could just be a buggy program in and of itself (I don't know
it
> very well).  However, I did tweak the language card write switch behavior
> to work a tiny bit more correctly, so it could fix other problems.
> 
> Anyway, JACE is working well enough to play two of the games that push the
> //e to the max and much help to all who helped keep me going with ideas. 
I
> swear I almost gave up a couple of times on this.
> 
> A build will be release again soon, I have a mockingboard routine to debug
> now.
> 
> -B
>

Brendan, I'm glad you fixed it :-). yeah those are hard!

How are you using multithreading? In OE I'm using four threads, a GUI
thread, a sound thread, a video thread and an emulation thread. I thought
about using even more threads (one for each emulation), but I found no way
to make the plumbing simple and effective :-(.

With the best wishes,

Marc.-