-
Notifications
You must be signed in to change notification settings - Fork 2
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
should SDL_CreateThread() work? #95
Comments
First crashlog has nothing todo with SDL as far as I can see, some C++ issue? SDL thread is used to play audio, for example, so it is expected to work. There are also thread test programs in test/ directory. However, in this case, on AmigaOS 4, I don't any sense to enable this multithread rendering for the following reasons:
Please don't enable multirendering. If you are more curious about the problem, use debug variants of SDL2 libraries and look at the serial. PS. Not sure why -lpthread is used, at least SDL2 doesn't use it. |
Hola capehill
El 21-04-2024, escribiste:
First crashlog has nothing todo with SDL as far as I can see, some C++
issue?
SDL thread is used to play audio, for example, so it is expected to work.
There are also thread test programs in test/ directory.
However, in this case, on AmigaOS 4, I don't any sense to enable this
multithread rendering for the following reasons:
1) Single-core operating system
2) This game engine is creating 2 threads (== AmigaOS processes) during
each frame! This is horrible. Those threads should be pooled. 3) Thread
creation result is not checked. If it fails, crash.
[...]
ok, thx for clarification, will disable such option.
Saludos
--
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P
|
Hola capehill
El 21-04-2024, escribiste:
First crashlog has nothing todo with SDL as far as I can see, some C++
issue?
SDL thread is used to play audio, for example, so it is expected to work.
There are also thread test programs in test/ directory.
[...]
If you are more curious about the problem, use debug variants of SDL2
libraries and look at the serial.
PS. Not sure why -lpthread is used, at least SDL2 doesn't use it.
Seems webp "package" uses pthreads:
...
/SDK/local/newlib/lib/libwebp.a(libwebpdecode_la-vp8_dec.o): In function `InitGetCoeffs':
/home/michael/libwebp-1.3.2/src/dec/vp8_dec.c:499: undefined reference to `pthread_mutex_lock'
/home/michael/libwebp-1.3.2/src/dec/vp8_dec.c:499: undefined reference to `pthread_mutex_unlock'
...
/SDK/local/newlib/lib/libsharpyuv.a(libsharpyuv_la-sharpyuv.o): In function `SharpYuvInit':
/home/michael/libwebp-1.3.2/sharpyuv/sharpyuv.c:448: undefined reference to `pthread_mutex_lock'
/home/michael/libwebp-1.3.2/sharpyuv/sharpyuv.c:462: undefined reference to `pthread_mutex_unlock'
Saludos
--
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonRX550/SSD240GB/DVDRW :-P
|
Hi, I just updated ZGloom (https://github.com/javierdlr/ZGloom_amigaos4 forked from https://github.com/Swizpig/ZGloom) and whne I enable "multithread rendering" option system crashes (attached).
Crashlog_ZGloom.zip
Crashlog_SDL thread floorthread.zip
it uses SDL_CreateThread() and SDL_LockMutex() in renderer.cpp
I build using "-athread=native -lpthread"
ppc-amigaos-g++ zgui.o binresource.o config.o decrunchmania.o font.o gamelogic.o gloommap.o gloommaths.o hud.o iffhandler.o menuscreen.o monsterlogic.o objectgraphics.o quick.o renderer.o script.o soundhandler.o titlescreen.o zgloom.o -I./LIBS/include -L./LIBS/lib -L/work/local/newlib/lib -fstack-protector -lSDL2_mixer -lxmp-lite -lmodplug -lSDL2_image -ltiff -lwebp -lpng16 -ljpeg -lSDL2 -lz -athread=native -lpthread -o ZGloom.debug
The text was updated successfully, but these errors were encountered: