Extending k_work safe? #63780
Unanswered
pauleffect90
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, guys!
Complete noob here on his first zephyr attempt, so kindly bear with him.
I'd like to use Workqueue threads to port my filesystem to zephyr. And I'm a little miffed by the k_work not having any user data fields.
I read the docs, I got the CONTAINER_OF part (pretty neat, never did occur to me to use offsets to get the parent element).
But that basically means I need to hold valid references to enclosing types, which means overhead for message queues (either zephyr's or my own, but in terms of CPU time and RAM). And my functions have 3 args and a callback, at most.
Now, to get to my question. How messed up would the following scenario be?
A caller requests access to the nand flash chip via:
The work handler:
UPDATE: Included RAISE_CALLBACK definition
#define RAISE_CALLBACK(ERROR_CODE) do { if(work->Callback) work->Callback(ERROR_CODE); } while(0)
Beta Was this translation helpful? Give feedback.
All reactions