Re: Re: chan copy -command callback not executed
Pat Thoyts <[email protected]> Sat, 16 Oct 2010 01:17:33 +0100
| Newsgroups | gmane.comp.lang.tcl.starkit |
|---|---|
| Message-ID | <[email protected]> |
On 14 October 2010 11:28, Pat Thoyts <[email protected]> wrote: > On 14 October 2010 10:01, Jos Decoster <[email protected]> wrote: >>> So - looks like the bug is in the metakit channel implementation and >>> the workaround is: >>> package require Mk4tcl >>> set ::mk4vfs::direct 1 >> >> Is there interest in fixing the metakit channel implementation or is >> adding this workaround sufficient? > > I've had a look at a related channel implementation for Microsoft > Structured Storage files that I wrote some time back and it contains > the same issue but is a bit simpler to examine. I believe what is > going on in both is that the fileevent handling is being delegated to > the notifier. The channel WatchProc is called when fileevent is set on > the channel. This toggles the flags and if the event is valid it just > sets the block time to 0. This means the tcl notifier (the stuff that > runs while you vwait) will trigger immediately. This then calls any > registered SetupProc's where we should look through the set of > channels created by this package and for any that have a watch flag, > trigger an event. This gets queued and ultimately runs the > Tcl_NotifyChannel. > On unix native filesystems this is all handled automatically by the > select that is part of the notifier code - thats why there is a unix > specific Tcl_CreateFileHandler to add the file desriptor to the select > set. > In the mk4 case there is no package specific notifer code registered > so I don't believe anything will ever call the mkEventProc where the > Tcl_NotifyChannel function should be called. In my tclftd2xx package I > have this stuff working for USB serial channels so I can copy over the > functionality from this and fix it up I reckon. Assuming I have this > correct. Certainly I expect to see some notifer procedures registered > for new channel implementations and this is missing them. > Fixed in kitgen's clone. See http://github.com/patthoyts/kitgen/commit/3ee246892b79bb83c8c96a2646124c6da94bbd3e I've added some tests to mk4tcl for fileevent and fcopy handling too. -- You received this message because you are subscribed to the "starkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/starkit?hl=en