-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
Refactor out staticDIR #3162
base: community
Are you sure you want to change the base?
Refactor out staticDIR #3162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we also need to configure fatfs as re entrant to do this safely, this change means multiple different dirs can be held but fatfs still can't access anything other than the last one it opened. To do that I think we need mutex support (and blocking) as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we have staticDIR is because iterating through a large directory is quite slow. Since there is a limit on how many directory entries can go into a SysEx reply, we limit each request to a small number of line items. If we iterated from the beginning to get to the subrange requested each time, it really does get slow. So I came up with a cache scheme.
@m-m-adams Looks like FatFS needs to be provided some stuff: ff_mutex_take, ff_mutex_give, ff_mutex_create and ff_mutex_delete.
@jamiefaye What do you mean? Git blame for staticDIR and staticFNO point to Rohan's original commit to the codebase. And staticDIR is never used in a function that doesn't call f_opendir() first, so it's never used contextually without a relevant creation the way that I would expect piecemeal loading works |
@jamiefaye if you're referring to sxDIR in
|
I am wrong about the staticDIR. The DIR iteration caching stuff is over in
smsysex.cpp.
– Jamie
…On Sat, Dec 28, 2024 at 2:12 PM Katherine Whitlock ***@***.***> wrote:
I think we also need to configure fatfs as re entrant to do this safely,
this change means multiple different dirs can be held but fatfs still can't
access anything other than the last one it opened. To do that I think we
need mutex support (and blocking) as well.
@m-m-adams <https://github.com/m-m-adams> Looks like FatFS needs to be
provided some stuff: ff_mutex_take, ff_mutex_give, ff_mutex_create and
ff_mutex_delete.
The reason we have staticDIR is because iterating through a large
directory is quite slow. Since there is a limit on how many directory
entries can go into a SysEx reply, we limit each request to a small number
of line items. If we iterated from the beginning to get to the subrange
requested each time, it really does get slow. So I came up with a cache
scheme.
@jamiefaye <https://github.com/jamiefaye> What do you mean? Git blame for
staticDIR and staticFNO point to Rohan's original commit to the codebase.
And staticDIR is never used in a function that doesn't call f_opendir()
first, so it's never used contextually without a relevant creation the way
that I would expect piecemeal loading works
—
Reply to this email directly, view it on GitHub
<#3162 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACDOGKRHABLGTUVP35QIEDT2H4A4HAVCNFSM6AAAAABUHRNVASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRUGQZDMNRWGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Removes global staticDIR in favor of local FatFS::Directory instances