From: SourceForge.net <no...@so...> - 2004-10-20 21:26:26
|
Patches item #875701, was opened at 2004-01-12 13:56 Message generated for change (Comment added) made by andreas_kupries You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=875701&group_id=10894 Category: 25. Channel System Group: TIP Implementation Status: Open Resolution: None Priority: 7 Submitted By: David Gravereaux (davygrvy) Assigned to: Andreas Kupries (andreas_kupries) Summary: TIP#218 (Tcl Channel Driver Thread State Actions) Initial Comment: Initial patch.. work in progress, aiming for inclusion in 8.5.0 ---------------------------------------------------------------------- >Comment By: Andreas Kupries (andreas_kupries) Date: 2004-10-20 14:26 Message: Logged In: YES user_id=75003 I added some more tests. I have now run tests against 8.5 head, and 8.4 head, pristine, with base patch, and base+driver patch (= 6 configs). I am unable to crash 8.5 with my tests, patches or not. 8.4 crashes the extended tests without patches, or only the base patch applied. It is ok if both base and driver patch are applied. This is for sockets. For pipes I was unable to crash my tests anywhere. It should however be possible to either crash transfered pipe channels, or to stop them from working (no events, due misdirected thread-alerts). I have found a limitation regarding transfered pipe channels and linux: Closing a transfered pipe channel in a different thread than it was created by causes an error, child lost. That seems to be a limitation in linux thread impl., and its interaction with waitpid. It is not a crash, just an error message about a lost child which is bogus. cleanup and all that seems to be ok however. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-10-14 14:23 Message: Logged In: YES user_id=75003 Seems that the thread extension does some basic tests of 'transfer', but only for files, in essence. It seems that I will have to extend this to cover all in-core drivers in some way or other. Uh, tests which are interdependent (18.1, .2, .3 for example). Nevertheless. This can be used for a basic first test. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-10-14 14:00 Message: Logged In: YES user_id=75003 And here is the first patch for the conversions of all in-core channel drivers to v4. Even if it was just something like changing the version number and adding NULLs to the structure. The patches passed compilation and testsuite of Tcl, on linux and windows, for regular and threaded build. _Not_ tested yet is that these changes actually work when a channel for their is truly transfered. Because (I believe) this is not tested by the in-core testsuite. The thread extension might test this. Investigation will start on that. Still, others are welcome to play with this now. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-10-08 13:45 Message: Logged In: YES user_id=75003 Yes, the removal of the Tclp{Cut,Splice}... from the old hackish fix will happen as part of the conversion of all internal drivers to v4. For this patch I just wanted to get the API completely implemented, and the core running flawlessly, without touching the core drivers and their hardwired threadactions. I had to touch the hardwired socket splice, or cut, because of a bug regarding "socketList" and "socketListLock". Wherever I did that I added commentary about the removed code, as explanation. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-10-08 13:36 Message: Logged In: YES user_id=7549 Interesting.. I see TclpSpliceFileChannel(chan); and TclpSpliceSockChannel(chan); still there.. If this patch is step#2, we'll save removing those for step#3 when we convert all the channel types to v4, yes? ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-10-08 13:15 Message: Logged In: YES user_id=7549 I'll modify my extensions to experiment on this. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-10-08 13:07 Message: Logged In: YES user_id=75003 Adding an updated ref. ipmlementation of the basics. The use of the thread actions when opening a channel means that existing code to add the instance data to a thread-global list is obsolete now, actually bogus, i.e. we get a damaged list. The updated diffs make the minimal changes necessary for the core to be ok again. This is not the convrsion of the existing drivers. This is enough for external channel drivers to use the API. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-09-10 13:07 Message: Logged In: YES user_id=75003 The TIP can be found at http://tip.tcl.tk/218 ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-09-10 13:05 Message: Logged In: YES user_id=75003 The TIP is in the official repository, with official formatting and such. Removing the draft. The (a) class patches (bugfixes not requiring a TIP) are now committed to HEAD (8.5 dev) and 8.4 branch head. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-09-09 15:58 Message: Logged In: YES user_id=75003 Attaching the TIP draft as well. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-09-09 15:55 Message: Logged In: YES user_id=75003 The patch had three components. (a) Bugs & Nits (b) v4 channel driver code. (c) Conversion of core drivers to v4. (a) can go into the core without TIP. (b) requires a TIP (c) is based on (b). Now enclosing a tarball for 8.4 and 8.5 implementing (b). The only thing missing are testcases for the new functionality. It does compile, and it does pass the unextended testsuite. I am ignoring (c) for now, until we get the TIP approved. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2004-09-09 13:37 Message: Logged In: YES user_id=75003 > 1) transformChannelType of generic/tclIOGT.c > had the version set to 2, not 3. It is setting > a wideSeekProc. Is 3 or 2 the correct version? 3 is the correct version. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-22 20:40 Message: Logged In: YES user_id=7549 This patch is not safe to use in its current form. I've found a bug i'm re-evaluating, a watchmask issue I need to solve. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-16 12:03 Message: Logged In: YES user_id=7549 Your note about checking HaveVersion was right. It will work in the forward direction, a v3 loaded into a core that understands up to v4, but not the other way. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-16 12:00 Message: Logged In: YES user_id=7549 Just discovered something interesting. If I create a v4 driver in an extension and load it into 8.4, Tcl_ChannelVersion incorrectly returns TCL_CHANNEL_VERSION_1 rather than TCL_CHANNEL_VERSION_3 The proper logic, I think would be to add a ceiling expecting more revisions in the future. Example: Tcl_ChannelTypeVersion Tcl_ChannelVersion(chanTypePtr) Tcl_ChannelType *chanTypePtr; /* Pointer to channel type. */ { if (chanTypePtr->version == TCL_CHANNEL_VERSION_2) { return TCL_CHANNEL_VERSION_2; } else if (chanTypePtr->version == TCL_CHANNEL_VERSION_3) { return TCL_CHANNEL_VERSION_3; } else if (chanTypePtr->version == TCL_CHANNEL_VERSION_4) { return TCL_CHANNEL_VERSION_4; /* reserve this space for future revisions. */ } else if (chanTypePtr->version < 15) { return TCL_CHANNEL_VERSION_4; } else { /* * In <v2 channel versions, the version field is occupied * by the Tcl_DriverBlockModeProc */ return TCL_CHANNEL_VERSION_1; } } ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-13 19:13 Message: Logged In: YES user_id=7549 Final patch ready that includes doc changes. Things to note: 1) transformChannelType of generic/tclIOGT.c had the version set to 2, not 3. It is setting a wideSeekProc. Is 3 or 2 the correct version? 2) *ALL* channel drivers that maintain any tsd data are all now at version 4. This includes every win channel type, now. Not just restricted to file and socket. 3) HaveVersion() should be fine, re. email note. 4) All internal channel types are at or greater than v2. Even the mac/ ones that no longer are maintained by anyone. 5) Do a 'make genstubs' after applying patch. 6) all tests pass for a threaded build of Tcl. Does testthread do a transfer test and are there test cases? I haven't looked yet. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-13 13:58 Message: Logged In: YES user_id=7549 rev #3 patch ready. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2004-01-13 02:16 Message: Logged In: YES user_id=79902 David, please don't set Status to Pending since it means that it is Pending Deletion if further information is not supplied. Which is not what you meant at all! ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-13 01:58 Message: Logged In: YES user_id=7549 Andreas, Could you have a look at this? Am I on-track? It looks complete to me ('cept for docs). How does it look to you? ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-12 16:48 Message: Logged In: YES user_id=7549 Note to self: add Tcl_DriverCutProc and Tcl_DriverSpliceProc to the Tcl_Channel man page. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-12 16:47 Message: Logged In: YES user_id=7549 Untested on unix and mac, but those area where touched by the patch and needs testers. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2004-01-12 16:45 Message: Logged In: YES user_id=7549 Only tested on Win2K. All tests pass for rev#2 !!! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=310894&aid=875701&group_id=10894 |