Artifacts Associated With Ticket 1350564fffffffffffffffffffffffffffffffff
Ticket change [54457aba06] (rid 93919) by setok on 2005-11-07 18:05:33:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
If I am doing an [fcopy] from chan1 to chan2 I cannot use a readable fileevent for chan1. This is completely understandable, but why does it not work the other way round? I would like to copy data from chan1 but also react to any responses coming from chan2 as soon as they arrive. However, this is not possible. Neither is setting a writable fileevent for chan1.
- foundin initialized to: "obsolete: 8.4.11"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "setok"
- subsystem initialized to: "25. Channel System"
- title initialized to: "Inadequate fcopy operation"
- type initialized to: "Bug"
Ticket change [42e1d39fcb] (rid 116448) by coldstore on 2005-11-22 14:30:55:
- icomment:
Logged In: YES user_id=19214 I'm not sure I follow ... the following code seems to work as I would expect it to, in a recent 8.5 - regardless of whether the [fileevent] occurs before or after the [fcopy]. Is the problem that a readable event won't trigger while the [fcopy] is active (that is, before Done is called?) proc readable {sock} { puts stderr "R: [gets $sock]" } proc done {args} { puts stderr "DONE: $args" } proc accept {sock args} { puts stderr "accept $args" set fd [open fcopy-socket.tcl r] fcopy $fd $sock -command done fileevent $sock readable [list readable $sock] } socket -server accept 9999 vwait forever - login: "coldstore"
- mimetype: "text/plain"
- username: "coldstore"
- icomment:
Ticket change [bb94208a9d] (rid 129510) by setok on 2005-11-23 18:24:27:
- icomment:
Logged In: YES user_id=137542 The manpage clearly states that no IO can be done with either channel. Presumably that would include reading from the outChan. In fact, I have seen this occur where I get something like a "channel is busy" error. I am not sure if your example is good for testing this as in such a small case it will likely have written out all data before the fileevent is triggered.
- login: "setok"
- mimetype: "text/plain"
- username: "setok"
- icomment:
Ticket change [9dda51d46b] (rid 96383) by ferrieux on 2008-04-05 05:36:39:
- icomment:
Logged In: YES user_id=496139 Originator: NO Fixed. Attaching a patch (including the two other recent fixes to fcopy) refining the blindly symmetrical busy test (non-null csPtr) by a direction-specific one. The refined test is: #define BUSY_STATE(st,fl) \ ((st)->csPtr && \ ( (((fl)&TCL_READABLE)&&((st)->csPtr->readPtr==(st)->topChanPtr)) || \ (((fl)&TCL_WRITABLE)&&((st)->csPtr->writePtr==(st)->topChanPtr)))) Also attaching 4 test scripts: - fev[12].tcl: run in two separate tclsh's, use an async fcopy and a reverse fileevent readable. - inetc.tcl,noria.tcl: run in three tclsh's: one noria and two inetcs, this establishes a bidirectional fcopy: anything typed into one inetc is displayed on the other one and vice versa. Last minute: heck, I cannot attach any files since I'm not the reporter ! What can I do ? - login: "ferrieux"
- mimetype: "text/plain"
- username: "ferrieux"
- icomment:
Ticket change [b026c5dd85] (rid 97929) by andreas_kupries on 2008-04-05 05:44:52:
- icomment:
Logged In: YES user_id=75003 Originator: NO Send them to me and I as maintainer should be able to attach them.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Add attachment "fcopy-dual.tar.gz" [e9a234492a] (rid 104848) by andreas_kupries on 2008-04-05 05:57:04.
Ticket change [53acf80292] (rid 93798) by andreas_kupries on 2008-04-05 05:57:05:
- icomment:
File Added - 273293: fcopy-dual.tar.gz Logged In: YES user_id=75003 Originator: NO File Added: fcopy-dual.tar.gz
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [3b35ca665a] (rid 112698) by andreas_kupries on 2008-04-05 06:03:44:
- priority changed to: "9 Immediate"
Ticket change [c800f35f1b] (rid 122034) by dgp on 2008-04-05 11:47:15:
- icomment:
Logged In: YES user_id=80530 Originator: NO let's just add ferrieux to the Developers list so he can attach patches. If his worthy contributions keep up, a maintainer hat for him may be in the mail. :)
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [fcf52cd172] (rid 108329) by andreas_kupries on 2008-04-07 22:44:10:
- icomment:
Logged In: YES user_id=75003 Originator: NO True that.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [1003d22faa] (rid 94890) by andreas_kupries on 2008-04-08 02:44:56:
- closedate changed to: "2008-04-07T19:44:56"
- closer changed to: "andreas_kupries"
- icomment:
Logged In: YES user_id=75003 Originator: NO Functionality committed to 8.4, 8.5, and head branches. Test case will follow.
- login: "andreas_kupries"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "andreas_kupries"
Ticket change [56f925ab6a] (rid 94414) by andreas_kupries on 2008-04-08 02:50:09:
- icomment:
Logged In: YES user_id=75003 Originator: NO And Alexandre is now on the developer's list for Tcl, currently only for 'Tracker Admin'. That should allow him to attach patches to other tracker item than his own.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [f23b262b2c] (rid 137786) by mi on 2014-04-28 19:11:13:
- assignee changed to: "aku"
- closedate changed to: "2456776.29946007"
- closer changed to: "mi"
- comment changed to:
If I am doing an [fcopy] from chan1 to chan2 I cannot use a readable fileevent for chan1. This is completely understandable, but why does it not work the other way round? I would like to copy data from chan1 but also react to any responses coming from chan2 as soon as they arrive. However, this is not possible. Neither is setting a writable fileevent for chan1.
- icomment:
<p align="justify">Though the fix (improvement) was committed into Tcl C-code, the documentation was never updated. The man-page for <tt>fcopy(n)</tt> still states: <blockquote>You are not allowed to do other I/O operations with inchan or outchan during a background fcopy.</blockquote> <p align="justify">The above sentence should be clarified and an example of bi-directional fcopy be added. <p align="justify">BTW, can I multiplex a single source into multiple destinations with fcopy (as <tt>tee(1)</tt> would do)? Should I be able to?
- login: "mi"
- mimetype: "text/html"
- severity changed to: "Minor"
Ticket change [d4b0924421] (rid 137788) by ferrieux on 2014-04-28 20:10:44:
- closedate changed to: "2456776.34079354"
- closer changed to: "ferrieux"
- icomment:
> BTW, can I multiplex a single source into > multiple destinations with fcopy (as tee(1) > would do)? Should I be able to? Not "out of the box", because async fcopy is a simple-minded "byte noria", that essentially spends its life alternating a readable and a writable fileevent (in C), guaranteeing no accumulation in memory. The noria requires to be alone fiddling with fileevents in that direction, otherwise there would be a race on the read side. If instead you want to "fork the flow", simply do a single fcopy towards a synthetic channel (refchan) that duplicates.
- login: "ferrieux"
- mimetype: "text/plain"
Ticket change [92349c570f] (rid 137792) by ferrieux on 2014-04-28 20:34:20:
- closedate changed to: "2456776.35718634"
- icomment:
Committed a clarification to fcopy.n [check-in a6e8d5d50c]. Thanks for feedback.
- login: "ferrieux"
- mimetype: "text/plain"