Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign interface between threads #109

Closed
mateoconlechuga opened this issue Mar 23, 2017 · 12 comments
Closed

Redesign interface between threads #109

mateoconlechuga opened this issue Mar 23, 2017 · 12 comments
Assignees
Milestone

Comments

@mateoconlechuga
Copy link
Member

This needs to be overhauled, it has gotten bloated and unmanageable. Also fix scheduling while you're at it.

@mateoconlechuga mateoconlechuga added this to the v1.0 target milestone Mar 23, 2017
@mateoconlechuga mateoconlechuga self-assigned this Mar 23, 2017
@adriweb
Copy link
Member

adriweb commented Mar 23, 2017

std::condition_variable will have to be your friend :)

@mateoconlechuga
Copy link
Member Author

Actually, I think the current system would work quite fine if variables were not crossing threads like they are now. The main emu QThread could simply pause the thread when debugging and whatnot.

@mateoconlechuga
Copy link
Member Author

Pretty much fixed with 6ae5d1c. Just needs testing I guess, and then this can be closed.

@adriweb
Copy link
Member

adriweb commented Apr 16, 2017

Well well well, seems to work fine on Desktop :)

But it completely broke emscripten: :P

  • It'd be nice not to have debug.c become debug.cpp just because of a condition variable a mutex. These are available in pure C as well (C11 that is).
  • Even when disabling debugging things, it appears to do "nothing", i.e. blank LCD. And I'm not sure what's happening since cpu_execute() seems to be running. Any idea?

@mateoconlechuga
Copy link
Member Author

C11 stuff isn't available to me and I'm not sure why...

As for the blank LCD, I don't know how it is being updated :P Is there a way I can test emscripten?

@adriweb
Copy link
Member

adriweb commented Apr 17, 2017

Aww, it appears not many stdlibs ship with C11 threads, so hum, I'll see if I can just use some preprocessor #ifs to just "comment out" the thread stuff for emscripten (since it's single-threaded there anyway). Unless we could just use pthreads, which is no issue on linux/mac, and on windows it's possible the winpthreads library is already used by the rest (?)
As for the blank LCD, I'm pretty sure the LCD itself isn't the issue, more like a symptom. (FWIW, I'm just calling lcd_drawframe(buf_lcd_js, &lcd); from time to time (when the JS requests it)).

Regarding testing emscripten yourself, hm, I can put some new version on the PB when the page is loaded with a special parameter or something... I'll let you know (but there isn't much to see :P)

@adriweb
Copy link
Member

adriweb commented Apr 17, 2017

So with a newer OS/ROM I had, it seems to be getting further, just excruciatingly slow :P
I'll keep poking around...

@adriweb
Copy link
Member

adriweb commented Apr 17, 2017

"solved" with 886b83c.

@adriweb adriweb closed this as completed Apr 17, 2017
@mateoconlechuga
Copy link
Member Author

I wouldn't consider it solved... what should be done to actually fix it? This could easily break again.

@adriweb
Copy link
Member

adriweb commented Apr 18, 2017 via email

@jacobly0
Copy link
Member

That's what aligned attributes are for. ;)

@adriweb
Copy link
Member

adriweb commented Apr 18, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants