logger: changed from RefCell to Mutex. #52
No reviewers
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/artiq-zynq#52
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "pca006132/artiq-zynq:log"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
The original implementation uses RefCell as core1 was not supposed to log messages, but this is not the case for zynq. This is to fix the possible race condition when two cores attempt to log messages at the same time.
Using mutex may reduce the throughput a bit, but it should not be too slow.
If the logger becomes a bottleneck, we can use multiple buffer for each core and use
AtomicPtr
to swap out the buffer to send to client while minimizing the downtime for the logger...