471,627 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Queue throughput.

Hi,

I have an application that uses a queue.

I have one thread that populates the queue and a second that takes items off
of the queue and processes them

At the moment all i have is these 2 threads. I may use another thread to
process the items separately so that i now have one thread that puts items on
the queue, another that takes items off the queue and a third that processes
the item.

My question is how do I control the throughput of the queue. What I would
like is the queue to not grow past a certain limit, for arguments sake 100
items.

It is important that items come off the queue and are processed quickly.

Is there a way to control this throughput?

Thanks In Advance
Macca
Feb 7 '06 #1
1 2206
I have built a generic bounded queue for just this use. Consumers will
block on empty Q and Producers will block on full Q.
The project also has a stream Pipe and a Pipe<T> built on the queue with a
sample app for ideas.
http://channel9.msdn.com/ShowPost.aspx?PostID=161030

--
William Stacey [MVP]

"Macca" <Ma***@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
| Hi,
|
| I have an application that uses a queue.
|
| I have one thread that populates the queue and a second that takes items
off
| of the queue and processes them
|
| At the moment all i have is these 2 threads. I may use another thread to
| process the items separately so that i now have one thread that puts items
on
| the queue, another that takes items off the queue and a third that
processes
| the item.
|
| My question is how do I control the throughput of the queue. What I would
| like is the queue to not grow past a certain limit, for arguments sake 100
| items.
|
| It is important that items come off the queue and are processed quickly.
|
| Is there a way to control this throughput?
|
| Thanks In Advance
| Macca
Feb 7 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by JP | last post: by
reply views Thread by Stephan Steiner | last post: by
2 posts views Thread by Sumanth | last post: by
3 posts views Thread by Jordi Rico | last post: by
3 posts views Thread by jrpfinch | last post: by
4 posts views Thread by j_depp_99 | last post: by
8 posts views Thread by Chizl | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.