Hi,

I am looking to use mmap to load data blocks within a large memory mapped 
file, but am getting "invalid argument" anytime i unmap a file for the 
second time.

See attached an example file which replicates this issue.  Note the firset 
read operation successed, and the file descriptor being used for the second 
batch is the same as the first.

go run unmap.go 

Got file test.mmap 3

Read 0 10

Got file test.mmap 3

panic: invalid argument


goroutine 1 [running]:

main.read(0x10b31e8, 0x9, 0xa, 0xa, 0x0, 0x0, 0xa)

unmap.go:69 +0x2a9

main.main()

unmap.go:87 +0x8b

exit status 2

This happens on mac OSX, as well as linux environment.  Can someone suggest 
what i am doing wrong if anything? 

A seconddary question is can I map/unmap the same file from different 
go-routines, or will I need to add locking around this file?

Cheers,
Julian.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: unmap.go
Description: Binary data

Reply via email to