Performance Problem - 9355

Hi all,

Still with a driver that is opening a COM port.
The driver is issuing a read request to the COM port.
On completion the driver is saving the buffer and queuing a DPC which will 
issue the next read to the COM port. This way the driver is reading as fast 
as it can.

Or at least this is what I thought. It looks like reads are completed with 0 
timer ticks (100ns) repeatedly when there is more to read.
If there is nothing to read then the next read will be in average of the 
real data sent but in multiples of 15 milliseconds exactly.

For example if 10 bytes are sent every 100ms then the driver will read all 
10 bytes with zero delay (less than 100ns). After 100ms the next 10 bytes are 
received but the read will start at a delay of either 93ms or 108ms, instead 
of 100ms.

This 15ms magic number appears with any COM port we used: USB, pciexpress, 
and on-board.
It is not the port's FIFO.

The question is: is this part of the limitation that Windows OS has by 
design, is it something configurable, or are we doing something wrong?

TIA,
Asaf
0
Utf
10/6/2010 8:38:03 PM
development.device.drivers 941 articles. 0 followers. Follow

3 Replies
784 Views

Similar Articles

[PageSpeed] 11

"Asaf Shelly" <MSMediaForum@Shelly.co.il> wrote in message 
news:04B5663E-2A75-4B09-A842-B9A2B49B5E05@microsoft.com...
> Hi all,
>
> Still with a driver that is opening a COM port.

Sure, these long holidays...

Symptom: "magic" 15 ms delay
Answer: this is the timer tick period.
Look for something that waits for event with timeout, or just for time, like
KeWaitForSingleObject, KeDelayExecutionThread, etc.
The com port i/o also has option for completion on timeout.

Regards,
-- pa

> The driver is issuing a read request to the COM port.
> On completion the driver is saving the buffer and queuing a DPC which will
> issue the next read to the COM port. This way the driver is reading as 
> fast
> as it can.
>
> Or at least this is what I thought. It looks like reads are completed with 
> 0
> timer ticks (100ns) repeatedly when there is more to read.
> If there is nothing to read then the next read will be in average of the
> real data sent but in multiples of 15 milliseconds exactly.
>
> For example if 10 bytes are sent every 100ms then the driver will read all
> 10 bytes with zero delay (less than 100ns). After 100ms the next 10 bytes 
> are
> received but the read will start at a delay of either 93ms or 108ms, 
> instead
> of 100ms.
>
> This 15ms magic number appears with any COM port we used: USB, pciexpress,
> and on-board.
> It is not the port's FIFO.
>
> The question is: is this part of the limitation that Windows OS has by
> design, is it something configurable, or are we doing something wrong?
>
> TIA,
> Asaf 

0
Pavel
10/7/2010 12:47:48 AM
Thanks Pavel,

What do I do if I need very accurate timing but don't want to poll the device?

Does this mean that the problem is with my device and if I had an upper 
filter I would have received all the data immediately?

Thanks,
Asaf


"Pavel A." wrote:

> "Asaf Shelly" <MSMediaForum@Shelly.co.il> wrote in message 
> news:04B5663E-2A75-4B09-A842-B9A2B49B5E05@microsoft.com...
> > Hi all,
> >
> > Still with a driver that is opening a COM port.
> 
> Sure, these long holidays...
> 
> Symptom: "magic" 15 ms delay
> Answer: this is the timer tick period.
> Look for something that waits for event with timeout, or just for time, like
> KeWaitForSingleObject, KeDelayExecutionThread, etc.
> The com port i/o also has option for completion on timeout.
> 
> Regards,
> -- pa
> 
> > The driver is issuing a read request to the COM port.
> > On completion the driver is saving the buffer and queuing a DPC which will
> > issue the next read to the COM port. This way the driver is reading as 
> > fast
> > as it can.
> >
> > Or at least this is what I thought. It looks like reads are completed with 
> > 0
> > timer ticks (100ns) repeatedly when there is more to read.
> > If there is nothing to read then the next read will be in average of the
> > real data sent but in multiples of 15 milliseconds exactly.
> >
> > For example if 10 bytes are sent every 100ms then the driver will read all
> > 10 bytes with zero delay (less than 100ns). After 100ms the next 10 bytes 
> > are
> > received but the read will start at a delay of either 93ms or 108ms, 
> > instead
> > of 100ms.
> >
> > This 15ms magic number appears with any COM port we used: USB, pciexpress,
> > and on-board.
> > It is not the port's FIFO.
> >
> > The question is: is this part of the limitation that Windows OS has by
> > design, is it something configurable, or are we doing something wrong?
> >
> > TIA,
> > Asaf 
> 
> .
> 
0
Utf
10/10/2010 10:46:03 PM
"Asaf Shelly" <MSMediaForum@Shelly.co.il> wrote in message 
news:06346E2F-382B-4E9A-82D7-B28FDFEE39EA@microsoft.com...
> Thanks Pavel,
>
> What do I do if I need very accurate timing but don't want to poll the 
> device?

Use interrupts, or try to lower the timer resolution.

> Does this mean that the problem is with my device and if I had an upper
> filter I would have received all the data immediately?

Not sure.

Regards,
--pa


> Thanks,
> Asaf
>
>
> "Pavel A." wrote:
>
>> "Asaf Shelly" <MSMediaForum@Shelly.co.il> wrote in message
>> news:04B5663E-2A75-4B09-A842-B9A2B49B5E05@microsoft.com...
>> > Hi all,
>> >
>> > Still with a driver that is opening a COM port.
>>
>> Sure, these long holidays...
>>
>> Symptom: "magic" 15 ms delay
>> Answer: this is the timer tick period.
>> Look for something that waits for event with timeout, or just for time, 
>> like
>> KeWaitForSingleObject, KeDelayExecutionThread, etc.
>> The com port i/o also has option for completion on timeout.
>>
>> Regards,
>> -- pa
>>
>> > The driver is issuing a read request to the COM port.
>> > On completion the driver is saving the buffer and queuing a DPC which 
>> > will
>> > issue the next read to the COM port. This way the driver is reading as
>> > fast
>> > as it can.
>> >
>> > Or at least this is what I thought. It looks like reads are completed 
>> > with
>> > 0
>> > timer ticks (100ns) repeatedly when there is more to read.
>> > If there is nothing to read then the next read will be in average of 
>> > the
>> > real data sent but in multiples of 15 milliseconds exactly.
>> >
>> > For example if 10 bytes are sent every 100ms then the driver will read 
>> > all
>> > 10 bytes with zero delay (less than 100ns). After 100ms the next 10 
>> > bytes
>> > are
>> > received but the read will start at a delay of either 93ms or 108ms,
>> > instead
>> > of 100ms.
>> >
>> > This 15ms magic number appears with any COM port we used: USB, 
>> > pciexpress,
>> > and on-board.
>> > It is not the port's FIFO.
>> >
>> > The question is: is this part of the limitation that Windows OS has by
>> > design, is it something configurable, or are we doing something wrong?
>> >
>> > TIA,
>> > Asaf
>>
>> .
>> 
0
Pavel
10/10/2010 11:07:14 PM
Reply:

Similar Artilces:

sending mail in outlook is problem?
i have problems with sending mail in outllk is problem.my outlook version is 2002? What problem are you having? Is there a specific error message? Has sending ever worked? "arabic models" <arabic models@discussions.microsoft.com> wrote in message news:79D9237E-A7BD-47EB-9F80-99C86C27B6A8@microsoft.com... > i have problems with sending mail in outllk is problem.my outlook version > is > 2002? ...

performances
performances Hi, I am writing c++ application in vc++ 6 the application use a lot of cpu processing (math calculations), I am running the application on Win-XP, p-4 2.8 HT! What is the best way to compile my application so it will run faster? What are the best ways to write or build my application for faster running? What i the different betwine processor type Blend* inn the C/C++ tab of the project setting and the other option??? Thanks! "Dave" <dbg@012.net.il> wrote in message news:eY8jUE38EHA.3756@TK2MSFTNGP14.phx.gbl... > performances > > Hi, > I am wr...

POP3 problems all of a sudden
Has anyone else come across a problem where the POP3 server service does not start and therefore virtual POP3 services are not available? My server reports: An error occurred while starting the Microsoft Exchange POP3 Service: server instance number 1 failed to start with error 0x80040a01. Event ID = 1036 Source = POP3SVC The service begins to start and reports this in the eventlog after a minute. Virtual POP3 service is not started and the only reported K/B article does not apply - I have checked (http://support.microsoft.com/kb/906154/en-us) the registry setting that is mentioned i...

Problem with Queue
Is it possible to restrict certain ppl from the same business unit to view a queue. I only want a small team from the business unit to access the queue and pick up the task. Or do I have to assign the team to a different business unit. Please help me out. Thank you in advance. -- Thank you -rev- Unfortunately CRM doesn't allow different levels of privilege for Queues; a user can either read all Queues (regardless of Business Unit), or none You could use different business units to limit permissions to the activities in the queue. However, the user can still see them in the queue (...

Pivot Table
Hello. I have a pivot table that tracks my medical expenses and insurance benefits. The layout uses the "Provider" field as a PAGE filter, and so I can see which provider is being displayed when I choose their name from the list. However, there are times that I want to view the information for ALL providers. But when I choose the "ALL" selection from the list, I can no longer tell which information goes with which provider because the provider's name is not one of the fields listed in the "ROW" layout. I have tried to add the Provider field to both the P...

mortgage budget problem
Hi, I know a lot of people have problems with that but I could not really find a solution (that I can understand) in the archive... I have Money 2003 (UK). I used to have my mortgage as a simple Bill payment (�500 per month). It was than included into my budget and cash flow review, as expected. Recently, I decided to enter the mortgage properly, as a Loan account, so that I can follow the reduction of my debt. Since I've done that, my mortgage dissapeared completely from the budget and cash flow forecast. INstead, at the end of the month, I have a new category called Special Debt...

Protected worksheet, shared workbook problems
I'm in quite the fix. I'm using XL2000 and 1. I have a shared workbook 2. ...that I want certain data protected 3. ..but I also want users to be able to insert rows. 2 and 3 together are not a problem because thanks to someone's suggestion, I insert rows via a macro where the macro first unprotects the data, then reprotects the correct data. 1, 2, and 3 is a problem since when a workbook is shared, you can't unprotect data and thus I can't do 2 and 3 if the workbook is shared. Is there anyway I can use my insert rows macro without having to unshare the workbo...

vba macro to perform custom reporting -transpose from rows to columns
I have one workbook and two sheets 1 sheet has data for automated test scenarios that may be run up to 3 time if they don't pass on the first or second try Sheet1: TestSet Test Result reason if failed 1 pass 2 pass 3 pass 4 fail x 4 fail y 4 fail z I want to create a summary report that looks like Sheet2 for the Sheet1 logs above test run1 result test run2 result test run 3result Sheet2 Testset result1 result2 result3 1 pass 2 pass 3 pass 4 fail fail fail So if a testset is executed more ...

Several Problems with CRM
Hi, I'm thinking that we are having some network architecture issues that are causing these problems but MS CRM has been a difficult pony to tame. We haven't been able to get the Exchange/Outlook integration to work. I have installed the Outlook app. to my machine and can access the CRM but I can't send email through the system, I can't access the contacts from the DB and I can't use it to create CRM appointments, etc. Late yesterday the CRM just up and died on us. My IS person backed up the SQL DBs but not the Active Directory (AD)and now he's not able to ge...

sbs 2008 networking problem
Folks I'm having a rather weird networking problem with a newly installed SBS 2008 server. Basically it would seem that I am loosing connection to the "outside world" after a while - more specifically after a few hours (or possibly after a few reboots, haven't figured it out yet)=85 This a a fairly typical SOHO setup - one SBS server, 6 client PC, one DSL bridge and a Zywall firewall / router. Everything worked just fine up until we decided to install said SBS 2008 server. Initially the setup was performed "by the book" and everything worked ou...

Simple xpath expression problem
I am trying to use a simple xpath expression, the code looks like this: Dim xdoc As New System.Xml.XmlDocument Dim xnode1 As System.Xml.XmlNode Dim xlist As System.Xml.XmlNodeList xdoc.LoadXml(Application("MenuXML")) xlist = xdoc.DocumentElement.SelectNodes("//MenuItem[@User=1]") For Each xnode1 In xlist xnode1.ParentNode.RemoveChild(xnode1) Next the xml document looks like this: <?xml version="1.0" encoding="utf-8" ?> <MenuRoot> <Page ID="101"> <M...

Problem with automatic standby
I'm running XP Home Edition. A while back I was suddenly not permitted, in the Desktop Properties, to rename and change settings on any of the Power Schemes. Unfortunately I don't remember what the error message said about that. I deleted all of the power schemes except one, to see if that would help, and it didn't. I am able (sometimes) to change the settings for the remaining power scheme, but I can't change the name. So I now have only the one power scheme, and can't create others under a different name. Any suggestions that might fix this? Larry Have ...

Out of office reply
I am trying to make an out of office reply. I know how to create the rule, however I do not have any templates. When I tried to make a template I do not have the option to save as.... a template. I have tried to manually save it in the correct folder, however it does not allow me to get to that folder via save as... I have Outlook 2007 Thank you for any help or suggestions! ...

Problem with investment in US$ with EUR as base currency
Hi, My base currency is EUR and have made investments in US$ and other currencies. Money makes all the conversions perfectly at first, and then after somtime converts the amounts of the interest and dividends received to EUR, hence giving all wrong totals, as the exchange rate for the interest rate and dividends cannot be changed, ( or at least I don't know how to do it). Is there any other way to achive this. Below are the transaction details to see the behaviour. EUR USD ACCOUNT BUY ON 15/07/2003 1 UNIT @ 7500 USD exchange rate 0.9734 value in EUR 7704, CORRECT. At today's...

Cursor Problem (WndClass?)
Hi,there! I'm trying to develop a drawing program in which I want have CROSS cursor in the drawing view some time. I learned from MSDN that "If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved. " I overlapped the PreCreateWindow() function and the code is like this: BOOL CMiniCADView::PreCreateWindow(CREATESTRUCT& cs) { if(!CView::PreCreateWindow(cs)) return FALSE; WNDCLASS WndC...

KB for Performance Optimizer trouble
In the process of moving EDB files from a crashed server to a new server built with same name, etc, but different platform (from NT to W2K Sp4) I found the Performance Optimizer would not allow me to move files to different volumes. A quick google search showed because of SP4 I needed to contact Microsoft for the patch but when I called they said I needed the KB article and I searched and searched and even none of the 'MVP' replies saying 'contact microsoft' had the KB number. After having the MS rep hold the line while I was scouring google and retrying the process to get the ...

Can't solve simple? problem. Can some genius out there help!
Want to pull simple data from two tables/sheets into a third and use formulas (array or otherwise), not macros or filters. I only want to select rows for customer CARL. Below is the example: Table Deposits (First Table, one data source) Customer Date Deposit Carl 1/25/2008 $150,000.00 Carl 2/28/2009 $50,000.00 Joe 3/5/2008 Table Withdrawls (2nd Table another data source) Customer Date Withdrawl Carl 1/28/2008 (6000) Joe 3/1/2008 (3000) Carl 4/12/2008 (4000) Joe 5/5/2008 (7000) The desired final result is listed below. The column with the name CARL can be omitt...

Business Contact Manager, performance sacrifices?
I'm hoping we can all learn a little about Business Contact Manager... After some initial difficulties that were resolved by 1.5 hours with Microsoft and some great ideas from Patricia Cardoza's new book, I've got Business Contact Manager running smoothly. That's a good thing because I provide support and training in Outlook to clients and want to be able to recommend this new add-on. But is it ready to recommend? Here are two things that seriously bother me: my contacts take so much longer to load and sort. Searching from the "Find a Contact" box formerly t...

Exchange2003 RPC over HTTP problem
I have tried to set up a simple configuration: a Windows2003 server with two network adapters. In one network I have an Exchange 2003 server and in the other network I had setup an Outlook 2003 client. The main purpose for this configuration is to get my client to connect to my Exchange server using RPC over HTTP using this simple configuration and only after this succeds, I want to install ISA Server 2004 on my two NICs server. The two NICs server is routing-enabled so there is proper TCP/IP communication between my two networks (succesfuly tested). I have configured my Outlook 2003 c...

Problem with a value in a variable
Hello, I'm trying to work with the events log : cmdlet "get-eventlog" I would like To test if I get some news events since two hours. This is my simple script : -------------------------------------------- $datedujour=$(get-date).AddHours(-2) $journal="Application" $listevents=get-eventlog $journal -Newest 1000 | where { ($_.timewritten -ge $datedujour) -and $_.entryType -match "warning|error"} $countevents=@($listevents).count IF ($countevents -gt 0) {$evtcheck="YES"} ------------------------------------------- But i ha...

crmaddin.dll problem
We are on CRM 4.0. I have one user with the following problem. The crmaddin.dll is disabled. Clicking on it to enable it does not work, it still remains disabled. I removed the dll from the add-ins and then tried to add it back again. I got this error message when trying to add it back - "crmaddin.dll is not a valid Office Add-in." I uninstalled and reinstalled the Outlook client and I am still getting the exact same results. Anyone have an idea of what might be going on here? Thanks, -Rick M. Forget this. I forgot to run the configuration wizard. -Rick M. "Ric...

Outlook PST File Problem
I recently have begun having problems with my Outlook PST file. This has never occurred before over the many years I have been using the same Outlook file and I believe the problems started happening right around the same time that I put in iTunes onto my PC and started to allow iTunes to sync my Outlook contacts with my iPhone. My Outlook file still more or less functions normally, but each time I open Outlook I get an error message telling me that the Outlook file was not closed properly the last time it was used and it much be checked for errors. It then does the check, which often it tak...

Problem in exchange mailbox
Hi, I have exchange 2003 with SP1 . I have configure one mailbox in outlook but when i receive mails in my mailbox it shows for seconds only in mailbox and disappears. i have checked in all the folders in mailbox but could not found . there is no any rules als. Pls help me on this issue. One more problem i am having when i sent any word or excel attachment outside the exchange server then the word or excel does not open on recepients end or the fond goets changed in word files... Pls help oh these issues. Regards, Abhi. pandeyabhishek2000@yahoo.com (abhishek pandey) wrote: >Hi, >I ...

Perform function...if?
Hi I have a workbook that I'm continually adding data to daily. and I also have another workbook that I want to perform calculations, but I only want the calculations performed IF there is data in the first workbook... Here are the two formulas the way they are now... ='Stock Return Data'!J24*0.25 ='Stock Return Data'!J24-'Tax Data'!A14 How can I tell both these functions, to only perform if there is data on the original worksheet? Thanks, Confused Man Hi try =IF('Stock Return Data'!J24<>"",'Stock Return Data'!J24*0.25,"&...

E2K3 Performance
My E2K3 server is having an occasional lag time in processing and would like some ideas on where to look at improving performance. 2.4 Xeon processor 1.3 Gb RAM Lot's of disk space Page Files are c: 1920 - 4096 and d: the same (seems incorrect, maybe should be static value?) When checking the running system, CPU is at 4% and pagefile is at 1.64 Gb. It's a low use server, less than 100 mailboxes and a backend to OWA out front. Suggestions appreciated. Thanks. ...