> On May 18, 2012, 6:25 a.m., Nilay Vaish wrote:
> > I think the implementation of WAIT is not correct. Here is what the man 
> > page has to say
> > 
> > FUTEX_WAIT
> >               This operation atomically verifies that the futex address 
> > uaddr still
> >               contains the value val, and sleeps awaiting FUTEX_WAKE on 
> > this futex
> >               address.  If the timeout argument is non-NULL, its contents 
> > describe
> >               the maximum duration of the wait, which is infinite 
> > otherwise.  The
> >               arguments uaddr2 and val3 are ignored.
> > 
> > 
> > In the current implementation, val is being not checked.

Nice catch. I've added and tested the missing value check.


> On May 18, 2012, 6:25 a.m., Nilay Vaish wrote:
> > src/sim/syscall_emul.cc, line 918
> > <http://reviews.gem5.org/r/1200/diff/1/?file=26449#file26449line918>
> >
> >     Do you know the Linux kernel / pthreads behavior in this case?

No. But now that I'm looking a little closer at the code. I don't see why the 
lists can't be deleted when their last item is popped. It seems unnecessary to 
have a memory leak here.


- Marc


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.gem5.org/r/1200/#review2709
-----------------------------------------------------------


On May 18, 2012, 4:38 p.m., Marc Orr wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.gem5.org/r/1200/
> -----------------------------------------------------------
> 
> (Updated May 18, 2012, 4:38 p.m.)
> 
> 
> Review request for Default.
> 
> 
> Description
> -------
> 
> Changeset 8984:e1fb70f89a2d
> ---------------------------
> syscall emulation: Add the futex system call.
> 
> 
> Diffs
> -----
> 
>   src/arch/x86/linux/syscalls.cc 4388495beb44ba859d20177371caf9e14902ef91 
>   src/sim/syscall_emul.hh 4388495beb44ba859d20177371caf9e14902ef91 
>   src/sim/syscall_emul.cc 4388495beb44ba859d20177371caf9e14902ef91 
> 
> Diff: http://reviews.gem5.org/r/1200/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Marc Orr
> 
>

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to