Discussion:
Long input strings
(too old to reply)
David Fallis
21 years ago
Permalink
Hi, If I run kba with the following input I get the below output...

1>@rees[101]% ./kba
INPUT KEYBOARD KBA USERS
===== ======== === =====
starting
starting
+A+A+A+A+A+A+A+A
read:+
read:A
read:+
read:A
read:+
read:A
read:+
read:A
read:+
read:A
read:+
read:A
read:+
read:A
read:+
read:A
read:\n
cmnd:+, new active user:0
task:0 starting
cmnd:+, new active user:1
task:1 starting
cmnd:+, new active user:2
task:2 starting
cmnd:+, new active user:3
task:3 starting
cmnd:+, new active user:4
task:4 starting
cmnd:+, new active user:5
task:5 starting
cmnd:+, new active user:6
task:6 starting
cmnd:+, new active user:7
task:7 starting
task:0 char:A
task:1 char:A
task: task:23
task: char: char: task:4A task:A5
task: char:
6
char:7A char:A char:
A
A


It works fine for small inputs, but the output gets all garbled when I try
certain long inputs. I've determined that it's just the output, the state
of my KBA is correct despite the appearance of the output.

Is this happening because different threads (in this case, several Users)
are using uCout at the same time?

Is there a way to fix this or will the markers not be concerned with this?

Thanks again,

David Fallis
Atul Sharma
21 years ago
Permalink
...
Might want to look into uAcquire and uRelease....page 146 of uC++
referennce book...
--
Atul Sharma
***@uwaterloo.ca
Faculty of Mathematics
Computer Science Major
Combinatorics & Optimization Minor
http://www.student.cs.uwaterloo.ca/~a4sharma
Loading...