race: syscall changes
This is a part of a bigger change that adds data race detection feature:
http://codereview.appspot.com/6456044
The purpose of this patch is to provide coarse-grained synchronization
between all Read() and Write() calls.
makes sense On Sun, Oct 7, 2012 at 7:22 AM, <rsc@golang.org> wrote: > > https://codereview.appspot.**com/6610064/diff/6019/src/pkg/** ...
12 years, 5 months ago
(2012-10-07 14:37:29 UTC)
#3
makes sense
On Sun, Oct 7, 2012 at 7:22 AM, <rsc@golang.org> wrote:
>
> https://codereview.appspot.**com/6610064/diff/6019/src/pkg/**
>
syscall/syscall_darwin.go<https://codereview.appspot.com/6610064/diff/6019/src/pkg/syscall/syscall_darwin.go>
> File src/pkg/syscall/syscall_**darwin.go (left):
>
> https://codereview.appspot.**com/6610064/diff/6019/src/pkg/**
>
syscall/syscall_darwin.go#**oldcode165<https://codereview.appspot.com/6610064/diff/6019/src/pkg/syscall/syscall_darwin.go#oldcode165>
> src/pkg/syscall/syscall_**darwin.go:165: //sys Read(fd int, p []byte)
> (n
> int, err error)
> Please let mksyscall do the generation of the system call. Instead, you
> can do
>
> //sys read
>
> here and then write
>
> func Read(fd int, p []byte) (n int, err error) {
> n, err = read(fd, p)
> racestuff
> return
> }
>
> Same for Write.
>
>
https://codereview.appspot.**com/6610064/<https://codereview.appspot.com/6610...
>
> ... > any ideas? Like Brad said, syscall.Read and syscall.Write have different signature on ...
12 years, 5 months ago
(2012-10-08 00:32:37 UTC)
#7
> ...
> any ideas?
Like Brad said, syscall.Read and syscall.Write have different signature on
windows. In fact, your CL does not compile on windows. You can see it yourself:
http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling.
The obvious way to fix your problem is to move Read and Write functions into
different source file with // +build !windows
in it. Unfortunately, we do not have one yet, so create one. You would also
need to add windows versions of Read and Write in syscall_windows.go
Alex
On 2012/10/08 00:32:37, brainman wrote: > > ... > > any ideas? > > Like ...
12 years, 5 months ago
(2012-10-08 11:27:18 UTC)
#9
On 2012/10/08 00:32:37, brainman wrote:
> > ...
> > any ideas?
>
> Like Brad said, syscall.Read and syscall.Write have different signature on
> windows. In fact, your CL does not compile on windows. You can see it
yourself:
> http://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling.
>
> The obvious way to fix your problem is to move Read and Write functions into
> different source file with // +build !windows
> in it. Unfortunately, we do not have one yet, so create one. You would also
> need to add windows versions of Read and Write in syscall_windows.go
Thanks! Done. PTAL.
Now I have version of Read/Write in syscall_unix.go, syscall_windows.go and
syscall_plan9.go. The tests pass now on Linux, and I've cross-built Windows
version as well.
On 2012/10/08 11:27:18, dvyukov wrote: > ... > Now I have version of Read/Write in ...
12 years, 5 months ago
(2012-10-08 22:34:44 UTC)
#10
On 2012/10/08 11:27:18, dvyukov wrote:
> ...
> Now I have version of Read/Write in syscall_unix.go, syscall_windows.go and
> syscall_plan9.go. The tests pass now on Linux, and I've cross-built Windows
> version as well.
windows part
LGTM
Even better then my suggestion (I have forgotten about syscall_unix.go).
Full build runs to success on windows/386
Alex
On Tue, Oct 9, 2012 at 2:34 AM, <alex.brainman@gmail.com> wrote: > On 2012/10/08 11:27:18, dvyukov ...
12 years, 5 months ago
(2012-10-09 03:57:52 UTC)
#11
On Tue, Oct 9, 2012 at 2:34 AM, <alex.brainman@gmail.com> wrote:
> On 2012/10/08 11:27:18, dvyukov wrote:
>
>> ...
>>
>> Now I have version of Read/Write in syscall_unix.go,
>>
> syscall_windows.go and
>
>> syscall_plan9.go. The tests pass now on Linux, and I've cross-built
>>
> Windows
>
>> version as well.
>>
>
> windows part
>
> LGTM
>
> Even better then my suggestion (I have forgotten about syscall_unix.go).
>
> Full build runs to success on windows/386
>
Russ?
Issue 6610064: code review 6610064: race: syscall changes
(Closed)
Created 12 years, 5 months ago by dvyukov
Modified 12 years, 5 months ago
Reviewers:
Base URL:
Comments: 1