Is there an efficient way to do a blocking read of tuples matching a template that will only read each tuple one time?
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
- Do the required matching funds have to be in cash, or can they be in-kind donations and services, e.g., staff time working on the program?
- Is there an efficient way to do a blocking read of tuples matching a template that will only read each tuple one time?
- Does the Parking Manager read the number plates during night time?