Regarding DiscardOldestWhen Blocked

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Regarding DiscardOldestWhen Blocked

NarayanaSwamy

Hi,

I tried the following combination for pooled executer

 

1.       Create a pooled executer with BoundedLinkedQueue of capacity 7.

2.       Set the minimum, maximum threads as 2.

3.       Set the keep alive time as -1

4.       Create the two threads

5.       set the policy as Discard oldest when blocked

 

Now when executing 11 tasks, 3 are getting dropped randomly (Sometimes may be 4)

Most of the times (2nd and 3rd or 4th task is getting dropped)

Randomly 2nd ,3rd and 4th are getting dropped ..

 

Can you please let me know the details?

 

Regards,

NarayanaSwamy A.

 

 


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: Regarding DiscardOldestWhen Blocked

Joe Bowbeer
With 11 tasks, queue limit of 7, and drop-oldest discard policy, the
first 4 tasks submitted could be dropped in the worst case.

If the pool threads start pulling tasks from the queue faster than
they can all be submitted, then some of the first tasks submitted (the
"oldest" tasks) will not be dropped.  That explains why you never see
task 1 dropped.

Drop-oldest is a heuristic designed for non-critical time-dependent
tasks where the result is likely to be stale the  longer the task sits
in the queue.  (Banner ads, for example.)


On 4/7/06, NarayanaSwamy <[hidden email]> wrote:

>
> Hi,
>
> I tried the following combination for pooled executer
>
> 1.       Create a pooled executer with BoundedLinkedQueue of capacity 7.
> 2.       Set the minimum, maximum threads as 2.
> 3.       Set the keep alive time as -1
> 4.       Create the two threads
> 5.       set the policy as Discard oldest when blocked
>
> Now when executing 11 tasks, 3 are getting dropped randomly (Sometimes may
> be 4)
>
> Most of the times (2nd and 3rd or 4th task is getting dropped)
>
> Randomly 2nd ,3rd and 4th are getting dropped ..
>
> Can you please let me know the details?
>
> Regards,
>
> NarayanaSwamy A.
>

_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

RE: Regarding DiscardOldestWhen Blocked

David Holmes-3
In reply to this post by NarayanaSwamy
Again it is a timing issue. If you submit tasks faster then they get pulled off the queue then you will be able to cause task 2 (or even task 1) to get dropped as it is the oldest, and you might cause up to 4 tasks to get dropped.
 
Again the issue is pre-starting the pool threads rather than creating them on demand. If you are going to pre-start then either don't immediately bombard the pool with submissions, or else ensure you have sufficient capacity in the queue to handle the bombard.
 
Cheers,
David Holmes
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of NarayanaSwamy
Sent: Saturday, 8 April 2006 3:39 AM
To: [hidden email]
Subject: [concurrency-interest] Regarding DiscardOldestWhen Blocked

Hi,

I tried the following combination for pooled executer

 

1.       Create a pooled executer with BoundedLinkedQueue of capacity 7.

2.       Set the minimum, maximum threads as 2.

3.       Set the keep alive time as -1

4.       Create the two threads

5.       set the policy as Discard oldest when blocked

 

Now when executing 11 tasks, 3 are getting dropped randomly (Sometimes may be 4)

Most of the times (2nd and 3rd or 4th task is getting dropped)

Randomly 2nd ,3rd and 4th are getting dropped ..

 

Can you please let me know the details?

 

Regards,

NarayanaSwamy A.

 

 


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

RE: Regarding DiscardOldestWhen Blocked

David Holmes-3
Just a clarification. Pre-starting of the core threads in this case only affects whether or not tasks 1 and 2 can be discarded as oldest. With pre-start they can, because the core threads may not have had a chance to do the take from the queue; but without pre-start tasks 1 and 2 are handed to the core threads directly. Thanks Joe for pointing this out.
 
Cheers,
David
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of David Holmes
Sent: Saturday, 8 April 2006 11:51 AM
To: NarayanaSwamy; [hidden email]
Subject: RE: [concurrency-interest] Regarding DiscardOldestWhen Blocked

Again it is a timing issue. If you submit tasks faster then they get pulled off the queue then you will be able to cause task 2 (or even task 1) to get dropped as it is the oldest, and you might cause up to 4 tasks to get dropped.
 
Again the issue is pre-starting the pool threads rather than creating them on demand. If you are going to pre-start then either don't immediately bombard the pool with submissions, or else ensure you have sufficient capacity in the queue to handle the bombard.
 
Cheers,
David Holmes
-----Original Message-----
From: [hidden email] [mailto:[hidden email]]On Behalf Of NarayanaSwamy
Sent: Saturday, 8 April 2006 3:39 AM
To: [hidden email]
Subject: [concurrency-interest] Regarding DiscardOldestWhen Blocked

Hi,

I tried the following combination for pooled executer

 

1.       Create a pooled executer with BoundedLinkedQueue of capacity 7.

2.       Set the minimum, maximum threads as 2.

3.       Set the keep alive time as -1

4.       Create the two threads

5.       set the policy as Discard oldest when blocked

 

Now when executing 11 tasks, 3 are getting dropped randomly (Sometimes may be 4)

Most of the times (2nd and 3rd or 4th task is getting dropped)

Randomly 2nd ,3rd and 4th are getting dropped ..

 

Can you please let me know the details?

 

Regards,

NarayanaSwamy A.

 

 


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest