In a hurry so quickly...

On 7 January 2013 12:00, Oliver Plohmann <[email protected]> wrote:
> Hello,
>
> I'm thinking of using the JavaSpaces services from just a single vm,
> something like a shared space for all the threads in the local vm. Is there
> a way to start the JavaSpaces service without JERI and all that so that I
> have no network overhead as everything is happening in the same single vm
> anyway? My idea is to use JavaSpaces for dealing with concurrency when doing
> multi-core programming.
>

Outrigger won't do this but Blitz does:
http://www.dancres.org/bjspj/docs/docs/extensions.html

As the docs say, make sure you create a TxnGateway stub impl (there's
an example in the test code). You can remove the System.out and it
should all work fine.

> Then I'm thinking of using the JavaSpaces service in some STM-like way, that
> is without any blocking (e.g. no blocking reads and takes). Problem is that
> transactions could still deadlock and I'm not guaranteed to be deadlock-safe
> as with STM. So I'm asking myself what will happen when some transactions
> run into a deadlock. Will one be rolled back after a timeout or will the
> deadlock just remain?

A deadlock can only happen in the cases where a client does two things:

(1) Waits on a take indefinitely.
(2) Holds a transaction open indefinitely having done a successful
read/take/write.

If, when a take fails, a client aborts the transaction and retries
(maybe with some random backoff) you're sorted.

Running transactions requires a transaction manager and unfortunately
at this point in time, there are none that run in embedded/local mode.
Blitz has most of the bits in there but it's not wired for the outside
world. Mahalo is the stock implementation in River which could work in
embedded mode.

Note if you want to use Mahalo, you'd need to use the remote
transaction gateway with LocalSpace above like the one found in
org.dancres.blitz.remote.

I could maybe get Blitz to do full transactions locally with a bit of
time but it won't happen in the next couple of days....

Hope that helps,

Dan.

>
> Thanks for any answers.
> Regards, Oliver
>
> --
>
> www.objectscape.org
>

Reply via email to