-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix examples Makefile to use Makefile.Web when building for web (Brings core/core_loading_thread example closer to working) #3449
Conversation
|
Yeah, most of the targets are copy paste of the default calls, and none seem like they should really be a separate target These modified calls being:
Seems it would be easy to just add those to the
I think the comment might not be completely accurate, I assume that comment is more in reference to the fact it's not by default? Looking at the documentation:
It seems the fix is to just do something like |
I am indeed able to get multiple threads running but I'm running into a very bizarre issue // We simulate data loading with a time counter for 5 seconds
while (timeCounter < 5000)
{
clock_t currentTime = clock() - prevTime;
timeCounter = currentTime*1000/CLOCKS_PER_SEC;
// We accumulate time over a global variable to be used in
// main thread as a progress bar
atomic_store_explicit(&dataProgress, timeCounter/10, memory_order_relaxed);
}
atomic_store_explicit(&dataLoaded, true, memory_order_relaxed); This loop never exits. Maybe the No, it definitely does. A logging message after the while loop never is hit either, which would mark the Also bizarrely enough, if I add a // We simulate data loading with a time counter for 5 seconds
while (timeCounter < 5000)
{
if(timeCounter > 4000)
TraceLog(LOG_ERROR, "time counter: %d", timeCounter);
clock_t currentTime = clock() - prevTime; It never actually outputs... But change that 4000 to a 2000, and it will get logged: I also tried to add logging to see if maybe the one thread was getting created multiple times, and some weird multithreading thing was happening, but nope: I attempted all above with consistent hard refeshes, Quite bizarre, I'm guessing some weird thing is happening with multithreading |
|
Not assuming My issue is that I think it should be maybe reworded a bit, to me the warning sounds like threads are completely unsupported, when in reality they can definitely be created and used |
Edit 1: editing. Edit 3:
Tested deleting it here and the examples compiled fine. |
@ubkp I'm afraid I couldn't find a better way to divide required resources per-example... Another solution would be using a separate directory and build system per example but I prefer to avoid that approach. |
@keithstellyes The improvement looks good to me, I didn't know about @ubkp @keithstellyes One improvement on that build system (that I got on my list) would be customizing every generated |
@keithstellyes I tried the new implementation and it does not work for me, how are you calling it? I try calling it from the predefined Notepad++ scripts:
|
@raysan5 That could be related to #3454. Between the changes there, I also changed the Perhaps the problem could be Note: Unfortunately I don't have a machine with Windows, so I can't test it. |
This PR originally changed it to |
@ubkp On Windows it used to work ok calling @keithstellyes I think |
Maybe the Makefile should use |
The
examples
Makefile wasn't properly usingMakefile.Web
which caused one of the bug in thecore/core_loading_thread
to not work (as mentioned in the wishlist 😊), as the compiler was not being passed the-s USE_PTHREADS=1
arg, consider the following terminal session, (edited for brevity)Output:
Output:
Note that the
Makefile.Web
does produce an output where it's a bit more zoomed in, exploded, whatever you wanna call it. But, this seems to be a pre-existing issue that is exposed by this fix.This was NOT tested with the Windows flow which probably needs testing (not sure if
emmake
is used there?)Note that the example still does not ever finish joining