Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
184 user(s) are online (163 user(s) are browsing Forums)

Members: 2
Guests: 182

amigait, VooDoo, more...

Support us!

Headlines

 
  Register To Post  

Are SDL threads reliable?
Site Builder
Site Builder


See User information
I am working on porting a game which compiles fine when using the SDL threads, but as soon as it tries to start I get a crash on threads, like below:

Stack trace:
    
native kernel module kernel+0x00036784
    native kernel module kernel
+0x0005c62c
    
[autodownload.cpp:80client:_Z13pingpckserverPv()+0x180 (section 1 0x1F72C)
    
ac_client:SDL_RunThread()+0x48 (section 1 0x2E94E8)
    
ac_client:OS4_RunThread()+0xa0 (section 1 0x2EA3D4)
    
native kernel module dos.library.kmod+0x00029e18
    native kernel module kernel
+0x0005f21c
    native kernel module kernel
+0x0005f294


In code I see something like below:

#ifdef USE_SDL_THREADS
    #include "SDL_timer.h"
    #include "SDL_thread.h"      // also fetches SDL_mutex.h
#else
    #include <pthread.h>
    #include <semaphore.h>
    #include <sys/shm.h>
#endif


I thought to try to compile without SDL threads, but because I am using newlib there is no semaphore.h there.

What I would like to ask, is SDL threads used or you always try to use something else?
Does anyone have any workaround for semaphore to be used with newlib?

Thank you for your help.

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: Are SDL threads reliable?
Just can't stay away
Just can't stay away


See User information
@walkero

SDL threads are used to play audio, at least.

I don't know if there are some limitations regarding networking, for example.

Go to top
Re: Are SDL threads reliable?
Just popping in
Just popping in


See User information
@walkero

psemaphore is available on os4depot
it's supposedly a good semaphore implementation for pthreads
I only read the os4depot description yet, haven't tried it yet.
But i think it's worth a shot if it is Semaphores you have trouble with.

Go to top
Re: Are SDL threads reliable?
Amigans Defender
Amigans Defender


See User information
what is the line of autodownload.cpp:80 ?

It doesn't seems a problem on threads but in the code (maybe because something doesn't work properly)

i'm really tired...
Go to top
Re: Are SDL threads reliable?
Site Builder
Site Builder


See User information
@afxgroup
There is some code for accessing an online server to download assets. The crash seems to happen before that line where there is a sdl_LockMutex() is happening. I am trying to figure out what exactly breaks with something like that, which should work fine.

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: Are SDL threads reliable?
Site Builder
Site Builder


See User information
It seems that if I disable the server downloading and the audio the game works, but it is pretty slow. Could that be something that is relevant to the threads?

Possibly are code problems I need to figure out and fix, but does this ring a bell to anyone?

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: Are SDL threads reliable?
Just can't stay away
Just can't stay away


See User information
@walkero

Maybe you can try Hieronymus. Have you confirmed that there isn't any serial debug slowing down? Is it 3D (MiniGL or OGLES2)?

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project