logs archiveBotHelp.net / Freenode / #3dsdev / 2015 / July / 25 / 1
norips
thanks Subv and yuriks iw ill try this :)
Hi :)
yuriks
hey
norips
still stuck with my recvfrom :/
sendto work but not recvfrom
Subv
now that i think about it, maybe our recvfrom implementation in citra is wrong
how does a syncrequest even block the caller client thread?
yuriks
by... blocking the thread? not sure what you're asking
Lectem
its possible that recvFrom doesnt trigger rescheduling
so once you're on it, you get stuck
yuriks
it's possible, but I doubt that's the case
norips: just to make sure, you're trying this on a real 3DS, right?
norips
both emulator and 3DS
stay there i will try on my 3DS with ninjah 2.0
maybe it's came from here
yuriks
I'm pretty sure citra will block incorrectly on recv calls, so yes, definitely try on the 3DS
norips
ok :)
Subv
yuriks: well that's the thing, i'm pretty sure that should cause a reschedule and just wakeup when finished, effectively behaving just like a nonblocking socket in the soc module
yuriks
ah, yes
Subv
aka, we're doing it wrong
yuriks
yeah, but doing it right is hard :)
Subv
is it
yuriks
yeah, our support for affecting the scheduler based on outside events is really crappy right now
but we're going to need it eventually, it's in my vague long term roadmap, along with HLE threads
Subv
how does the soc module do it?
yuriks
Subv: dunno, probably waits for an interrupt events or something
Subv
it probably just delays the ReplyAndReceive call until after the socket is ready
norips
Subv setsockopt doesn't implemented yet on citra, right ?
Subv
norips: nope
norips
ok :)
yuriks
Subv: yeah, but my point was that we don't have good support for making outside events cause scheduling of threads
our only solution right now is polling using an idle callback
Subv: erm, #citra(-dev)? guess this is OT here
norips
yuriks: with the 3DS the recvfrom doesn't block the console by calling it from a thread but, it freeze when i try to print what it receive, am i doing something wrong ? :/
Here is my pastebin http://pastebin.com/7G1BRZLa
Lectem
where does it freeze zxactly?
norips
Lectem: 64th line i think, it print Received the following: but no other thing
yuriks
norips: are you receinving ASCII data?
norips
yep
yuriks
ugh
norips: volatile isn't atomic :|
anyway, not sure if printf is thread-safe, try printing only from the main thread
norips
i don't know C very well a this point :) what's the difference and when to use ?
I will try printing from main thread
Lectem
check the value of n
in case of error
yuriks
norips: volatile isn't for cross-thread communication
unfortunately, I'm not sure dkA/ctrulib has *any* decent support for atomics or userland mutexes so you're pretty much out of luck
norips
ok :)
i use this example for thread https://github.com/smealum/ctrulib/blob/master/examples/threads/event/source/main.c
thanks Lectem i will try this too
is there a better way to load 3dsx expect by Web browser > Rxmode emunand > cubic ninja > hb menu ?
except
yuriks
not afaik
norips
ok :)
yuriks
well
you can skip the first two steps and just boot into CN, I guess?
norips
yeah but i don't have the game atm, so .. i bypass it :)
OHH thanks you yuriks Subv and Lectem
yuriks
it was the prints?
norips
fyi without calling printf from the thread it work like a charm :)
Exactly
I will keep this in a part of my mind for a next time :)
neobrain
(Action) sighs
yuriks
?
« prev next »