Subject: | Re: Illegal operation exception in lock-free Stack |
---|---|
Date: | Sat, 11 Dec 2010 18:41:57 -0500 |
From: | Pranay Prabhakar <ppp...@columbia.edu> |
Reply-To: | coms49...@googlegroups.com |
To: | coms49...@googlegroups.com, Yoav Zibin <yoav....@gmail.com> |
CC: | kks...@columbia.edu |
I have no atomic block which has wait, at or async. Pranay Quoting Yoav Zibin <yoav....@gmail.com>: > yes, inside an atomic section some operations are not allowed: > wait, at , async > (because atomic sections should be as small as possible). > > On Sat, Dec 11, 2010 at 6:21 PM, Pranay Prabhakar > <ppp...@columbia.edu>wrote: > >> >> I have implemented my version of the lock-free Stack. However, on calling >> either push or pop operation I get the following error: >> >> x10.lang.IllegalOperationException: illegal operation exception >> x10.lang.IllegalOperationException: illegal operation exception >> at x10::lang::Throwable::fillInStackTrace() >> at x10::lang::Activity::ensureNotInAtomic() >> at x10::lang::Runtime::ensureNotInAtomic() >> at x10::lang::Latch::await() >> at x10::lang::Runtime__RootFinish::waitForFinish(bool) >> at x10::lang::Runtime::start(x10aux::ref<x10::lang::VoidFun_0_0>, >> x10aux::ref<x10::lang::VoidFun_0_0>) >> at int x10aux::template_main<x10::lang::Runtime, Stack>(int, char**) >> at __libc_start_main >> at std::ios_base::Init::~Init() >> >> The implementation is on the lines of lock-free Queue given in the notes. >> Any ideas as to what I should be looking for to debug this? >> >> >> Thanks, >> Pranay >> >> >> >> >> >
So thanks for unearthing this.
The work-around you have found would appear to be correct: wrap the
invocation in an atomic.
I am puzzled how this error relates to the error you reported earlier
--- the IllegalOperationException. These seem to be two very different
things..?
Best,
Vijay
> Dropping the distribution list as this is a HW code.
>
> Thanks,
>
> Pranay