[REFACTOR] Introduce QNX Single Thread Logging#799
Open
minminlittleshrimp wants to merge 1 commit intomasterfrom
Open
[REFACTOR] Introduce QNX Single Thread Logging#799minminlittleshrimp wants to merge 1 commit intomasterfrom
minminlittleshrimp wants to merge 1 commit intomasterfrom
Conversation
1. Pthread APIs in QNX follow POSIX standard, hence, to avoid undefined behaviors: - Return value from each API call will be handled - Manually allocate stack size for thread - Reduce thread queue to one for logging only to avoid unlimited threads creation - Use only 1 thread to handle logging, with stack size fixed to 12K (4K aligned) 2. Injection callback: - Since only 1 thread is used, callback injection will now do infinity wait inside slogger2_callback 3. Handle properly dlt thread in normal exit: - Add an atomic_bool for thread cancellation in normal main thread exit case. 4. Handle slog2_thread heap memory: - slog2_thread is now allocated on HEAP, in case of failure or normal exit, free this HEAP allocated memory is required to prevent memory leak. During thread allocation on heap, the pointer stackaddr shall be round up to the nearest aligned memory address within 16K memory allocated. Example: Heap 16K memory |-------------|------------------------| 0x1003 0x2000-aligned MAX_MEM MAX_MEM - 0x1003 = 16K MAX_MEM - 0x2000 >= 12K Signed-off-by: LUU QUANG MINH <Minh.LuuQuang@vn.bosch.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example: Heap 16K memory
|-------------|------------------------|
0x1003 0x2000-aligned MAX_MEM
MAX_MEM - 0x1003 = 16K
MAX_MEM - 0x2000 >= 12K