# Distributed Services with Go: Index - Write Sync in index (Page 35)

**URL:** <https://forum.devtalk.com/t/distributed-services-with-go-index-write-sync-in-index-page-35/50572>\
**Category:** PragProg Customers\
**Tags:** book-distributed-services-with-go, question\
**Created:** [18 April 2022 00:16 UTC](https://forum.devtalk.com/t/distributed-services-with-go-index-write-sync-in-index-page-35/50572 "2022-04-18T00:16:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juca](https://forum.devtalk.com/letter_avatar_proxy/v4/letter/j/6f9a4e/32.png) [@Juca](https://forum.devtalk.com/u/Juca)\
**Post date:** [18 April 2022 00:16 UTC](https://forum.devtalk.com/t/distributed-services-with-go-index-write-sync-in-index-page-35/50572/1 "2022-04-18T00:16:00Z")

</div>

@travisjeffery

PDF - Page 35

No need to synchronize this function? How mmap work with multiple writers?.

func (i \*index) Write(off uint32, pos uint64) error {  
if uint64(len(i.mmap)) \< i.size+entWidth {  
return io.EOF  
}  
enc.PutUint32(i.mmap[i.size:i.size+offWidth], off)  
enc.PutUint64(i.mmap[i.size+offWidth:i.size+entWidth], pos)  
i.size += uint64(entWidth)  
return nil  
}

Same question for function  
func (s \*segment) Append(record \*api.Record) (offset uint64, err error)

Thank you,

JC.
