🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #17772

Re: serial comPort events are swallowed on dual processor boards

#17772
From: Jurgen Bartels
Date: Sun, 01 Dec 2002 15:41
52 lines
2766 bytes
On Thu, 24 Oct 2002 11:16:55 -0500, "Brian Cook"
<bcook@rowdydogsoftware[REMOVE].com> wrote:

Brian,

>I used a dual processor computer for about four years to develop serial port
>(and TCP/IP) communications software.  Not once did I have a problem related
>to the fact that the computer was dual processor.  A dual processor
>computer, in my opinion, should do better at handling communictions than an
>equivalent single processor computer for the simple reason that at any given
>moment in time it is roughly twice as likely that a processor is available
>to handle an interrupt.

I now found, that it regularly happens when the message is about 10
bytes long. If it is longer than 20..30 bytes it never happens.

>
>>    SetCommMask(hCom, EV_TXEMPTY);
>
>Really should be...
>
>    SetCommMask(hCom, EV_TXEMPTY or EV_BREAK or EV_ERR);
>
>And somewhere you should be making calls to...
>
>    GetCommMask
>    ClearCommError
>
>To determine what happened.

It did not report any errors.

However, I noticed, that cbOutQue always reports 0 bytes when calling
this right after WriteFile() :

   if (!WaitCommEvent(hCom, &evMask, &os1))
    if (GetLastError() == ERROR_IO_PENDING)
    {
       ClearCommError(hCom, &Errors, &Stat)
      ....
    }

However when the message length is 20, cbOutQue is != 0 
(some bytes still in the queue)

Perhaps with 10 bytes all bytes go into the UART TX buffer at once and
an EV_TXEMPTY interrupt will randomly be missed ?

Jurgen

Jurgen Bartels, Taunusstein near Wiesbaden, Germany
jurgenb@rheingau.netsurf00.de  ( remove zeros in adr )
Technical Details
Message-ID: <m9akuu84r5g7ata0lk5n4gtmnkmd2vcttq@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail
References: <3db7e3ef.14080144@forums.borland.com> <3db81cf5@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,656e3d8601ce1bde,start
X-Google-Attributes: gid10cc67,public
X-Google-Thread: f94dd,656e3d8601ce1bde,start
X-Google-Attributes: gidf94dd,public
X-Google-ArrivalTime: 2002-12-01 08:15:51 PST
From: Jurgen Bartels <jurgenb@rheingau.netsurf00.de>
Newsgroups: borland.public.cppbuilder.nativeapi,borland.public.delphi.nativeapi
Subject: Re: serial comPort events are swallowed on dual processor boards
Date: Sun, 01 Dec 2002 16:41:55 +0100
Message-ID: <m9akuu84r5g7ata0lk5n4gtmnkmd2vcttq@4ax.com>
References: <3db7e3ef.14080144@forums.borland.com> <3db81cf5@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.92/32.572 trialware
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 213.216.12.47
X-Trace: newsgroups.borland.com 1038757298 213.216.12.47 (1 Dec 2002 07:41:38 -0800)
Lines: 52
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail