-
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
Rlock - unexpected behavior #24035
Comments
i test on mac os with latest release: go version go1.10 darwin/amd64 - same problem |
Link on commit recoilme/slowpoke@4912806 |
With Rlock - when writing in file seek positioning at wrong position I open file with os.O_CREATE|os.O_RDWR |
You can't seek around a file concurrently. This isn't a Go question or problem. The seek position is stored in the kernel, associated with the open file. You'll need to use ReadAt or use separate files. For questions about Go, see https://golang.org/wiki/Questions. |
go version go1.8.1 darwin/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?mac os 10.12.6
What did you do?
write and read in file from multiple goroutine at same time
What did you expect to see?
I write with lock and read with rlock same file. And read with seek (0,0)
What did you see instead?
When i use Rlock + Seek to the beginning of file - seek return 0 but really not seek at beginning of file
With Lock - not reproduce
reproduce: https://github.com/recoilme/slowpoke/blob/master/syncfile/syncfile_test.go#L46
problem here: https://github.com/recoilme/slowpoke/blob/master/syncfile/syncfile.go#L50
The text was updated successfully, but these errors were encountered: