Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2011-02-15
03:46 • Closed ticket [3175754fff]: memchan fifo events plus 7 other changes artifact: fd637eb811 user: andreas_kupries
03:46 • Ticket [3175754fff]: 4 changes artifact: da0e8fc824 user: andreas_kupries
2011-02-08
16:34 • New ticket [3175754fff]. artifact: c89f0b2eef user: anonymous

memchan fifo events

Closed / Fixed3175754fffffffffffffffffffffffffffffffffCreated 16 years agoUpdated 16 years ago
Descriptionplain2011-02-08 16:34:55
Using the Memchan fifo command, the read events are not being consistent, not triggered at all, triggered only after reading at least one character first. 

Example: 
% package req Memchan 
2.3 
% set c [fifo] 
fifo0 
% chan event $c readable r 
% proc r {} {puts "read -- [read $::c]"} 
% puts $c "testing read" 
% flush $c 
% update 
% read $c 1 
t 
% update 
read -- esting read 
##########################

It can also 
generate false positives: 
  % package require Memchan 
  2.3 
  % set c [fifo] 
  fifo0 
  % fileevent $c readable {puts stderr READ:; puts stderr "([read $::c 
1])"} 
  % update 
  READ: 
  () 
  % update 
  READ: 
  () 

#############################

Even stranger, fileevents stop when data are ready ! 
  % fconfigure $c -buffering line 
  % puts $c aa 
  % update 
  % update 
  % update 
  % read $c 1 
  a 
  % update 
  READ: 
  (a) 
  READ: 
  ( 
  ) 
  % update 
  READ: 
  () 
  % update 
  READ: 
  () 
########################

I tried it Tcl 8.5 and 8.6. Same issue on both.
andreas_kupriesplain2011-02-15 03:46:37
Fixed. Indeed, an inverted condition dropping readable events when actually needed.

Side note: This bug was found in Memchan, and should have been reported to the Memchan project @ SF, and not the Tcl core. It was fixed in Memchan too. I accepted the misfile this time because I would have been the person to fix it anyway, regardless of filing location.
andreas_kupriesplain2011-02-15 03:46:47
allow_comments - 1
Log in (anonymous is fine) to add a comment.