Need lock while building pipeline?

View: New views
4 Messages — Rating Filter:   Alert me  

Need lock while building pipeline?

by Danilo Tuler-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

I'm getting this exception while buildind a GL pipeline.
I think the problem is related to a lack of lock, because I think the
list is being populated (with the apropriate writeLock) while the
pipeline is being constructed.
Do I need to acquire a lock in this situation? Read or write?

java.lang.NullPointerException
        at ca.odell.glazedlists.impl.adt.barcode2.SimpleTree.get(SimpleTree.java:151)
        at ca.odell.glazedlists.SortedList.getSourceIndex(SortedList.java:372)
        at ca.odell.glazedlists.TransformedList.get(TransformedList.java:103)
        at ca.odell.glazedlists.impl.Grouper.groupTogether(Grouper.java:282)
        at ca.odell.glazedlists.impl.Grouper.setComparator(Grouper.java:79)
        at ca.odell.glazedlists.impl.Grouper.<init>(Grouper.java:64)
        at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:93)
        at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:67)
        at br.com.investtools.trader.ui.filter.transaction.TransactionBrokerFilter.<init>(TransactionBrokerFilter.java:77)

Thanks,
Danilo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


re: Need lock while building pipeline?

by Kevin Day :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yup - if you are adding an 'active' list to a new pipeline, then you need to honor locking semantecs.  During list setup, the calls should be read-only (there may be exceptions to this, but I can't think of any).  So grab a read lock on the list that you are building the pipeline against, build the pipeline, then drop the lock.

The write lock will block the read lock (or vice-versa) and you should be in business.

- K


----------------------- Original Message -----------------------
 
From: "Danilo Tuler" <tuler@...>
To: users@...
Cc:
Date: Thu, 29 May 2008 20:12:31 -0300
Subject: Need lock while building pipeline?
 
Hi guys,

I'm getting this exception while buildind a GL pipeline.
I think the problem is related to a lack of lock, because I think the
list is being populated (with the apropriate writeLock) while the
pipeline is being constructed.
Do I need to acquire a lock in this situation? Read or write?

java.lang.NullPointerException
   at ca.odell.glazedlists.impl.adt.barcode2.SimpleTree.get(SimpleTree.java:151)
   at ca.odell.glazedlists.SortedList.getSourceIndex(SortedList.java:372)
   at ca.odell.glazedlists.TransformedList.get(TransformedList.java:103)
   at ca.odell.glazedlists.impl.Grouper.groupTogether(Grouper.java:282)
   at ca.odell.glazedlists.impl.Grouper.setComparator(Grouper.java:79)
   at ca.odell.glazedlists.impl.Grouper.<init>(Grouper.java:64)
   at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:93)
   at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:67)
   at br.com.investtools.trader.ui.filter.transaction.TransactionBrokerFilter.<init>(TransactionBrokerFilter.java:77)

Thanks,
Danilo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Need lock while building pipeline?

by James Lemieux :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Kevin is correct, a read-lock is the correct lock to obtain.

Nice catch, by the way. Locking during pipeline construction is typically a problem people overlook and can't explain...

James

On Thu, May 29, 2008 at 8:23 PM, Kevin Day <kevin@...> wrote:
Yup - if you are adding an 'active' list to a new pipeline, then you need to honor locking semantecs.  During list setup, the calls should be read-only (there may be exceptions to this, but I can't think of any).  So grab a read lock on the list that you are building the pipeline against, build the pipeline, then drop the lock.

The write lock will block the read lock (or vice-versa) and you should be in business.

- K


----------------------- Original Message -----------------------

From: "Danilo Tuler" <tuler@...>
To: users@...
Cc:
Date: Thu, 29 May 2008 20:12:31 -0300
Subject: Need lock while building pipeline?

Hi guys,

I'm getting this exception while buildind a GL pipeline.
I think the problem is related to a lack of lock, because I think the
list is being populated (with the apropriate writeLock) while the
pipeline is being constructed.
Do I need to acquire a lock in this situation? Read or write?

java.lang.NullPointerException
  at ca.odell.glazedlists.impl.adt.barcode2.SimpleTree.get(SimpleTree.java:151)
  at ca.odell.glazedlists.SortedList.getSourceIndex(SortedList.java:372)
  at ca.odell.glazedlists.TransformedList.get(TransformedList.java:103)
  at ca.odell.glazedlists.impl.Grouper.groupTogether(Grouper.java:282)
  at ca.odell.glazedlists.impl.Grouper.setComparator(Grouper.java:79)
  at ca.odell.glazedlists.impl.Grouper.<init>(Grouper.java:64)
  at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:93)
  at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:67)
  at br.com.investtools.trader.ui.filter.transaction.TransactionBrokerFilter.<init>(TransactionBrokerFilter.java:77)

Thanks,
Danilo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...



RE: Need lock while building pipeline?

by Jeremy Ford :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
In the same vane, you will need to lock while disposing of you list as well.   Usually, you will want a write lock, especially in the case where you have an ObservableElementList.


Date: Sun, 1 Jun 2008 14:40:58 -0700
From: jplemieux@...
To: users@...
Subject: Re: Need lock while building pipeline?

Kevin is correct, a read-lock is the correct lock to obtain.

Nice catch, by the way. Locking during pipeline construction is typically a problem people overlook and can't explain...

James

On Thu, May 29, 2008 at 8:23 PM, Kevin Day <kevin@...> wrote:
Yup - if you are adding an 'active' list to a new pipeline, then you need to honor locking semantecs.  During list setup, the calls should be read-only (there may be exceptions to this, but I can't think of any).  So grab a read lock on the list that you are building the pipeline against, build the pipeline, then drop the lock.

The write lock will block the read lock (or vice-versa) and you should be in business.

- K


----------------------- Original Message -----------------------

From: "Danilo Tuler" <tuler@...>
To: users@...
Cc:
Date: Thu, 29 May 2008 20:12:31 -0300
Subject: Need lock while building pipeline?

Hi guys,

I'm getting this exception while buildind a GL pipeline.
I think the problem is related to a lack of lock, because I think the
list is being populated (with the apropriate writeLock) while the
pipeline is being constructed.
Do I need to acquire a lock in this situation? Read or write?

java.lang.NullPointerException
  at ca.odell.glazedlists.impl.adt.barcode2.SimpleTree.get(SimpleTree.java:151)
  at ca.odell.glazedlists.SortedList.getSourceIndex(SortedList.java:372)
  at ca.odell.glazedlists.TransformedList.get(TransformedList.java:103)
  at ca.odell.glazedlists.impl.Grouper.groupTogether(Grouper.java:282)
  at ca.odell.glazedlists.impl.Grouper.setComparator(Grouper.java:79)
  at ca.odell.glazedlists.impl.Grouper.<init>(Grouper.java:64)
  at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:93)
  at ca.odell.glazedlists.UniqueList.<init>(UniqueList.java:67)
  at br.com.investtools.trader.ui.filter.transaction.TransactionBrokerFilter.<init>(TransactionBrokerFilter.java:77)

Thanks,
Danilo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...




It’s easy to add contacts from Facebook and other social sites through Windows Live™ Messenger. Learn How.
LightInTheBox - Buy quality products at wholesale price