Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(276)

Issue 6820098: code review 6820098: runtime: fix deadlock in parallel for test (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by dvyukov
Modified:
13 years, 11 months ago
Reviewers:
CC:
golang-dev, bradfitz
Visibility:
Public.

Description

runtime: fix deadlock in parallel for test The deadlock occurs when another goroutine requests GC during the test. When wait=true the test expects physical parallelism, that is, that P goroutines are all active at the same time. If GC is requested, then part of the goroutines are not scheduled, so other goroutines deadlock. With wait=false, goroutines finish parallel for w/o waiting for all other goroutines. Fixes issue 3954.

Patch Set 1 #

Patch Set 2 : diff -r 311b51675518 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 311b51675518 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r 311b51675518 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r fd3746c787ac https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -2 lines) Patch
M src/pkg/runtime/parfor_test.go View 1 2 3 4 1 chunk +9 lines, -2 lines 0 comments Download

Messages

Total messages: 3
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
13 years, 11 months ago (2012-11-06 15:36:42 UTC) #1
bradfitz
LGTM I'd probably use a WaitGroup here, but this works too. On Tue, Nov 6, ...
13 years, 11 months ago (2012-11-06 16:03:11 UTC) #2
dvyukov
13 years, 11 months ago (2012-11-06 16:11:38 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=0852bd93e466 ***

runtime: fix deadlock in parallel for test
The deadlock occurs when another goroutine requests GC
during the test. When wait=true the test expects physical parallelism,
that is, that P goroutines are all active at the same time.
If GC is requested, then part of the goroutines are not scheduled,
so other goroutines deadlock.
With wait=false, goroutines finish parallel for w/o waiting for all
other goroutines.
Fixes issue 3954.

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/6820098
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b