-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tour: Concurrency: Exercise Web Crawler would profit from hint about mutex #13110
Comments
Hi @bernhardreiter, thanks for your feedback! I'm going to try to add a couple of slides mentioning Also, awesome job finishing the tour!! Your rock 👍 |
Proposed change: https://go-review.googlesource.com/17403 |
CL https://golang.org/cl/17403 mentions this issue. |
Hi Francesc, thank for maintaining the gotour. :) Took a quick look at your proposed change:
Best, |
CL updated |
sync.Mutex is needed to solve the last exercise of the tour Fixes golang/go#13110 Change-Id: I0b10f8c0fc0e3c656377b93bdbf40e38c5cb762b Reviewed-on: https://go-review.googlesource.com/17403 Reviewed-by: Rob Pike <r@golang.org> X-Tour-Commit: ee3e019a7c9cb1e8e5889af4089bee4195a27ea9
sync.Mutex is needed to solve the last exercise of the tour Fixes golang/go#13110 Change-Id: I0b10f8c0fc0e3c656377b93bdbf40e38c5cb762b Reviewed-on: https://go-review.googlesource.com/17403 Reviewed-by: Rob Pike <r@golang.org> X-Tour-Commit: ee3e019a7c9cb1e8e5889af4089bee4195a27ea9
sync.Mutex is needed to solve the last exercise of the tour Fixes golang/go#13110 Change-Id: I0b10f8c0fc0e3c656377b93bdbf40e38c5cb762b Reviewed-on: https://go-review.googlesource.com/17403 Reviewed-by: Rob Pike <r@golang.org>
Hi,
just took the tour, it was nice.
I have a suggestion for the last exercise-web-crawler.go.
I could solve the task to run the crawlers in parallel using the channels,
but the task to only crawl urls once could need more hints, it was too hard.
As I am only a beginner once, I'm reporting it.
As far as I say, solving the task of "crawling urls only onces" requires either
before and probably would need a way to build individual channels to each goroutine or a way to have them all ask over one common channel) if an url has already been crawled or
Both have not been explained in the tour before. The reference solution uses the mutex.
Now I could have read up on the "sync" packages to use a mutex, but because
page concurrency/1 said that this was rarely necessary, I expected a higher level way to exist.
Which I could not find in a reasonable timeframe so I gave up and looked at the solution in the source.
My suggestions are:
file to start a go routine to a previous example, I found it non-obvious when looking at webcrawler.go
tour master commit 1c790b9f8bfefe44f33fbc9aacf5a6bc06027321 Date: Tue Oct 20 14:55:43 2015 -0700
Chromium with go1.5.1 in i386 in Debian GNU/Linux.
Best Regards,
Bernhard
The text was updated successfully, but these errors were encountered: