| View previous topic :: View next topic |
| Author |
Message |
lgnr
Joined: 17 Dec 2009 Posts: 39
|
Posted: Sat Jul 03, 2010 6:46 am Post subject: Switching to Multi-Threading = Crash |
|
|
Hello guys.
I have made a little single-threaded UDP socket client on PSP, to connect to the server com the PC.
Wonderful, everything went great.
Now, i fell the need to run that stuff on a thread, in order to run a server in another thread.
What I did was just wrap the old stuff on a callback function and start a thread with it.
When i run it on the PSP, the function is called, but the screen outputs just the firsts chars on the first printf(), and then freezes.
What I did:
[code]
int create_client()
{
//Conect to AP, get user input for server's address, send messages to the server
}
int client_thread()
{
thid = sceKernelCreateThread("client_thread", create_client, 0x18, 0x1000, 0, 0);
sceKernelStartThread(thid, 0, 0);
}
int main()
{
//Init everything
client_thread();
//Sleep 1000 ms
sceKernelSleepThread();
}
[/code]
Any tips?
Thanks in advance. |
|
| Back to top |
|
 |
Criptych
Joined: 12 Sep 2009 Posts: 79
|
Posted: Sat Jul 03, 2010 8:13 am Post subject: |
|
|
Not sure exactly what you're calling in the new thread, but 4kb isn't much room. Maybe you wanted 64kb (0x10000)? _________________ PSP-2000 // CFW: 5.50 GEN-D2 ...and not upgrading until OFW supports homebrew!
(But I did downgrade to 1.50 with TimeMachine...)
"I want you to tell me how the machine makes you feel." |
|
| Back to top |
|
 |
lgnr
Joined: 17 Dec 2009 Posts: 39
|
Posted: Sat Jul 03, 2010 8:38 am Post subject: |
|
|
Dude, that just sad. Lost hours of my life on this.
Works perfect now. Thank you sir very much for helping idiots like myself. :) |
|
| Back to top |
|
 |
Criptych
Joined: 12 Sep 2009 Posts: 79
|
Posted: Sun Jul 04, 2010 12:52 am Post subject: |
|
|
| lgnr wrote: | Dude, that just sad. Lost hours of my life on this.
Works perfect now. Thank you sir very much for helping idiots like myself. :) |
No problem. I know this one from experience. :) _________________ PSP-2000 // CFW: 5.50 GEN-D2 ...and not upgrading until OFW supports homebrew!
(But I did downgrade to 1.50 with TimeMachine...)
"I want you to tell me how the machine makes you feel." |
|
| Back to top |
|
 |
|