logger: changed from RefCell to Mutex. #52

Merged
sb10q merged 1 commits from pca006132/artiq-zynq:log into master 2020-07-15 17:15:09 +08:00

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...

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...
sb10q closed this pull request 2020-07-15 17:15:09 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#52
There is no content yet.