Concurrency: 1115. Print FooBar Alternately#230
Merged
Conversation
Contributor
|
Caution Review failedThe pull request is closed. 📝 WalkthroughSummary by CodeRabbitリリースノート
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughLeetCode問題1115(Print FooBar Alternately)の新しい実装を追加。Go言語での複数同期戦略(チャネル、sync.Cond、sync.Mutex)とPython言語でのセマフォベースの実装を含むノートブック、およびREADMEと対話的HTMLドキュメントを新規追加。 Changes
Sequence Diagram(s)sequenceDiagram
participant G1 as Goroutine 1<br/>(Foo)
participant Ch as Channel/<br/>Synchronization
participant G2 as Goroutine 2<br/>(Bar)
G1->>Ch: Check turn (wait if not ready)
Ch-->>G1: Signal ready for Foo
G1->>G1: Execute printFoo()
G1->>Ch: Send Foo done signal
G2->>Ch: Check turn (wait if not ready)
Ch-->>G2: Signal ready for Bar
G2->>G2: Execute printBar()
G2->>Ch: Send Bar done signal
rect rgb(100, 200, 100)
G1->>Ch: Check turn (iteration n)
Ch-->>G1: Signal ready
G1->>G1: Execute printFoo()
end
rect rgb(100, 150, 200)
G2->>Ch: Check turn (iteration n)
Ch-->>G2: Signal ready
G2->>G2: Execute printBar()
end
Note over G1,G2: Alternates until n iterations
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
No description provided.