misc runtime patch #103

Merged
sb10q merged 3 commits from pca006132/artiq-zynq:runtime into master 2020-09-02 10:15:52 +08:00
There is no content yet.
sb10q reviewed 2020-09-01 16:36:31 +08:00
@ -17,1 +18,4 @@
core0_tx = CHANNEL_0TO1.lock().take();
// prevent deadlock...
// the compiler optimized this routine so fast that it would deadlock
for _ in 0..100 {

Are 100 nops actually needed? Why not 1?

Are 100 nops actually needed? Why not 1?

I just add the nops randomly, perhaps a smaller number would do.

I just add the nops randomly, perhaps a smaller number would do.

If the problem is a compiler optimization, a single nop (without a for loop) should do, no?

If the problem is a compiler optimization, a single nop (without a for loop) should do, no?

The problem is not compiler optimization, we were having a race condition, and the compiler optimization just make it occur consistently. This fix would not fix the race condition, but provide better chance for core1 to get the mutex. In theory it can still deadlock, but very unlikely.

The problem is not compiler optimization, we were having a race condition, and the compiler optimization just make it occur consistently. This fix would not fix the race condition, but provide better chance for core1 to get the mutex. In theory it can still deadlock, but very unlikely.
sb10q closed this pull request 2020-09-02 10:15:52 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 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#103
There is no content yet.