Questions about allocations

Posted: 09-19-2003, 07:10 AM
I'm creating a driver based on the the PassThru example. I need to maintain
a queue of packets, some of which may be delayed before being sent. My
question is two-fold. I'm not entirely sure the Passthru example is the way
I should go, but from my limited reading so far, it seems the best choice.

Essentially, what I want to do is slow down certain types of packets. So I
need to maintain a queue of packets that are to be sent (or received) and
will add packets to the queue as necessary.

Now, I can make the queue a static length of, say 50 packets, and I doubt I
would run into problems. On the other hand, I hate having fixed length
arrays because it either wastes memory or potentially causes problems if you
overflow.

What sort of penalty would I be incurring by periodically resizing the
array, when necessary? Keep in mind that if I resize the array, all the
packets will need to be moved, or possibly, I could follow the
packet-chaining idea and simply chain the arrays together, although that
then makes the coding a bit trickier and becomes one more potential source
of error, but I'm willing to go that route if I'm looking at a severe
penalty that could cause a signficant traffic slowdown when the array is
reallocated.

My second question is in regards to how to handle delays. Suppose I decide a
packet must be delayed, and I want to check in, say 1 second, whether or not
it's time to send the packet. How can I have code that's called on a timer,
(or at least called multiple times per second, if I can't control the
timing), to do this check?

I'll likely have many more questions over the following weeks and months, as
this is my first attempt at doing a device driver.

Thanks.

Pete




Reply With Quote

Responses to "Questions about allocations"

 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
questions MARCELO Windows XP Photos 0 09-14-2003 08:17 PM
questions MT Windows XP Movie Maker 1 08-08-2003 03:15 PM
Need Help On 2 Questions Please Nick Windows XP 1 07-09-2003 11:55 PM
More EWF questions Sean Liming \(eMVP\) Windows XP Embedded 3 07-09-2003 05:15 PM
Two Questions... Sooner Al Windows XP Work Remotely 1 07-04-2003 12:22 PM