|
Re: ArrayBlockingQueue and addAll(): msg#00037java.jsr.166-concurrency
Kasper Nielsen wrote: > Hi, > > Any reason for not letting ArrayBlockingQueue.addAll() use a more > efficient implementation then the one inherited from AbstractCollection? > It is mainly because there's not a huge possibility for improvement. Suppose for example a queue with capacity 100 gets calls from two different threads to addAll with 200 elements each. At best you could put in the first 100 for the first one, and let the others contend one-by-one as consumers remove elements. This and other small improvements aren't usually enough faster that letting all of them contend one-by-one to deserve explicit coding. Although people who frequently hit cases where it would be enough faster to bother, might feel differently. So it is a good suggestion for a potential small performance improvement, that we ought to take up someday. Thanks! -Doug
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Escaping "this" reference in constructors, Kasper Nielsen |
|---|---|
| Next by Date: | Re: ArrayBlockingQueue and addAll(), Kasper Nielsen |
| Previous by Thread: | ArrayBlockingQueue and addAll(), Kasper Nielsen |
| Next by Thread: | Re: ArrayBlockingQueue and addAll(), Kasper Nielsen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |