logs archiveBotHelp.net / Freenode / #3dsdev / 2015 / September / 4 / 3
nopy4869
RE and spec | Code from spec
I need to... inSPECt it!
UnSPEC plx
endrift
wish I could figure out why my thread stuff is broken
nopy4869
BTW, I wrote a tool based on http://3dbrew.org/wiki/Configuration_Memory#ARM11_Kernel_Configuration_Memory
Just for saving the described pages :3
I posted it on Github, if anyone's interested
I haven't played around with the threads yet, but it would be cool if you could put core and video on separate threads.
You could even have a piece of data that tells when the frame is being messed with and, if the emulator isn't ready for the screen to draw it just tells the draw thread to wait
From what I remember reading, though, put the lighter load on the first thread
I remember reading that the first thread can only use like %30 of the cpu on that thread on o3ds and like %80 on n3ds, but don't quote me on that.
What processor id are you using on the CreateThread function?
endrift
1
also yeah I've seen that before
yuriks
Why do you crash, PICA, why?
endrift
also nopy4869 I'm about to push the branch where I do that
it crashes on the 3DS
nopy4869
http://3dbrew.org/wiki/Multi-threading#CreateThread
It seems like you're passing the wrong coreid
what I'm reading is that that's syscore on o3ds
endrift
well okay I can try -2
nopy4869
Please do
endrift
but that will just give me the same core
nopy4869
Not necessarily
-2 gives default CPU, whereas 1 will always give the same cpu regardless of the run
Also, I wouldn't trust Citra to tell you what core it'll run on on the 3ds
yuriks
yeah, citra doesn't implement the two cores at all
nopy4869
Citra looks like it's an HLE
yuriks
we do do error checking on the parameters though
(by doesn't implement it just means it schedules everything as if there was only 1 core)
nopy4869
And Citra is actually one of the coolest projects I've sen in a long time
endrift
it actually almost works in citra
almost
the synchronization seems to be a bit broken
nopy4869
What does, the single core scheduling?
BTW, is it working with core-2?
mgba, that is
endrift
just crashed when I tried that
I need to go to bed shortly though
nopy4869
Yeah, me too. did you make sure that you set the stacktop in a sane place and gave it a good entrypoint?
Sorry, just eager to help :)
endrift
oh! I finally got the thread to start
looks like my condition variables are broken after all
I'll need to do the futex stuff yuriks was talking about
nopy4869
Wait, did you mean mutex?
endrift
no
futex = fast userspace mutex
nopy4869
Hmm...
I haven't ever heard of that before
Could you possibly push the changes and send me a copy of the 3dsx before you go to bed? :3
I would love to see if there are any performance upgrades in it :)
Additionally, did you set the first thread as the less intensive one?
endrift
nopy4869: do you know much about 3DS's semaphores?
or yuriks for that matter
yuriks
as in, the kernel object?
endrift
yes
yuriks
what about them?
nopy4869
Not a whole lot. I've just gotten into 3ds coding and have only really started learning about the lower levels of what's actually happening in programs over the past year. I've only heard of the various types of things in passing :/
profi200
You still can avoid pointer aliasing which removes ennecessary slow loads. That should speed it up a little bit.
endrift
profi200: yeah, most of that will be in the graphics code
yuriks: when I create a semaphore it asks for an initial count
when I try to svcWaitSynchronization the semaphore, will that increase or decrease the current count?
I always have trouble wrapping my head around semaphores
yuriks
decrease, it blocks when the count is 0
endrift
ah
yuriks
think of the semaphore count as the number of available resources
nopy4869
Alright well I'm off to bed. Nice talking to you guys again
endrift
so what I want is the semaphore to block the first time I try to acquire it
and then I can tell it to release from another thread
profi200
If you just have 2 threads in total you could as well just use a mutex.
nopy4869
set the initial count to 0?
profi200
(Main thread and another one)
yuriks
bye
endrift: oh, I don't know if that'll work
iirc semaphores count is a max
you can't start with 0 and then release
endrift
oh hm
yuriks
but check citra on that
endrift
I know the way you're supposed to implement a condition variable is with a semaphore and a mutex
yuriks
a semaphore *and* a mutex?
oh, ok
makes sense
profi200
But why a semaphore if you create only 1 extra thread?
yuriks
profi200: she's just fixing her abstraction layer I think
endrift
yeah
also I want to be able to speculatively wake the other thread
that's important
so does the semaphore block when it REACHES zero or when it tries to GO BELOW zero?
yuriks
don't remember, check citra on that
*sigh*, I'm resorting to diffing commandlists
endrift
hey! It doesn't crash anymore!
profi200
But does it give any benefits? Also how good does it sync?
endrift
the sync is either too heavy, or it's on the same thread. can't tell
I'll commit and push for now, then try futex stuff tomorrow
profi200
So basically what i said. It causes too much problems.
endrift
Was anyone expecting otherwise?
yuriks
meanwhile I'm still blackscreening lol
writing this code from scratch was a terrible idea
should've copied from one of the templates I always use
endrift
:(
« prev 1 2 3 4 next »