Thank you all for these very informative comments and suggestions. We are planning to add this functionality in the second phase of Orchestrator development. We will use these alternatives to come up with the design. Will keep you informed.
On Wed, Jan 22, 2014 at 10:37 PM, Patanachai Tangchaisin < [email protected]> wrote: > Hi Sachith, > > Most race condition problem can be solved by solving following problems: > 1. locking on shared resources e.g. table row locking, java object > synchronization, etc. > 2. the visibility of shared resources i.e. how and when changed is made > visible through other threads. > > If this race condition is caused by thread cannot communicate with each > other by JDK synchronization e.g. threads are not in the same JVM. You > might need distributed locking/queuing mechanism. > > You could look into Apache Curator, which is built on top of Apache > Zookeeper. > http://curator.apache.org/curator-recipes/index.html > > === > Patanachai > > > > On Wed, Jan 22, 2014 at 12:12 PM, Supun Kamburugamuva <[email protected] > >wrote: > > > Hi Sachith, > > > > AFAIK I think what you need is a Queue abstraction on top of the table. > The > > workers (NewJobWorker) will poll the queue for new jobs. The queue will > > contain the ACCEPTED jobs from the table. Only one thread will get a job. > > Is this approach viable for you? > > > > Thanks, > > Supun.. > > > > > > On Mon, Jan 20, 2014 at 10:59 AM, Sachith Withana <[email protected] > > >wrote: > > > > > Hi all, > > > > > > There are race condition issues when using the multi-threaded > > > Orchestrator. We need to come up with a way to synchronize the threads. > > > > > > Does anyone have any experiences or ideas regarding the issue? > > > > > > > > > On Mon, Jan 20, 2014 at 9:34 AM, Marlon Pierce <[email protected]> > wrote: > > > > > >> This sounds like a good question for the architects@airavata list. > > >> > > >> > > >> Marlon > > >> > > >> On 1/20/14 2:29 AM, Saminda Wijeratne wrote: > > >> > Suresh suggested we use existing libraries. Does anyone have any > > >> experience > > >> > in using them? > > >> > > > >> > > > >> > On Sun, Jan 19, 2014 at 3:55 PM, Lahiru Gunathilake < > > [email protected] > > >> >wrote: > > >> > > > >> >> Hi Sachitha, > > >> >> > > >> >> > > >> >> On Sun, Jan 19, 2014 at 6:41 PM, Sachith Withana < > > [email protected] > > >> >wrote: > > >> >> > > >> >>> Hi all, > > >> >>> > > >> >>> There are race condition issues when using the multi-threaded > > >> >>> Orchestrator. > > >> >>> > > >> >> +1, There's another thread we agreed on this. (subject: > Orchestration > > >> >> Component implementation review). > > >> >> > > >> >> Lahiru > > >> >> > > >> >>> We need to come up with a way to synchronize the threads. > > >> >>> > > >> >>> Any suggestions? > > >> >>> > > >> >>> -- > > >> >>> Thanks, > > >> >>> Sachith Withana > > >> >>> > > >> >>> > > >> >> > > >> >> -- > > >> >> System Analyst Programmer > > >> >> PTI Lab > > >> >> Indiana University > > >> >> > > >> > > >> > > > > > > > > > -- > > > Thanks, > > > Sachith Withana > > > > > > > > > > > > -- > > Supun Kamburugamuva > > Member, Apache Software Foundation; http://www.apache.org > > E-mail: [email protected]; Mobile: +1 812 369 6762 > > Blog: http://supunk.blogspot.com > > > -- Thanks, Sachith Withana
