Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Is there an efficient way to do a blocking read of tuples matching a template that will only read each tuple one time?

0
Posted

Is there an efficient way to do a blocking read of tuples matching a template that will only read each tuple one time?

0

An event register for writes that match the template will do just that. You can start with a scan that will pick up the matching Tuples that were already written. • Can multiple transactions within a single space overlap in time? You can in fact have multiple transaction active at any one point of time, you just have to have multiple instances of the TupleSpace object all pointing to the same Space. For example: TupleSpace ts1 = new TupleSpace(“space”,host); Transaction tr1 = new Transaction(); tr1.addTupleSpace(t1); TupleSpace ts2 = new TupleSpace(“space”,host); Transaction tr2 = new Transaction(); tr2.addTupleSpace(ts2); tr1.beginTrans(); tr2.beginTrans(); ts1.write(… ts2.write(… tr1.commitTrans(); tr2.commitTrans(); Of course you can have each of these in a separate thread but the idea is the same. Please also note that you can not have a single Transaction and 2 threads issuing commands to a single TupleSpace unless you ensure that at the time that Trans.commit() is called, all

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123