I have no idea what that means, Brian, so I'm also amused. But we all gotta be full of something, don't we? And maybe you've just explained my own fat fingers. (This is too much fun...) 8^)
-John
Brian F. G. Bidulock wrote:
John,
Lol. You're full of little red ants.
--brian
On Fri, 10 Oct 2003, John A. Boyd Jr. wrote:
Point taken, Brian, IF read & write close are to do exactly the same thing. What it they are to be different?
This has become a philosophical debate, and unfortunately, as I've noted often lately, I don't have access here to any STREAMS docs (mine have been in storage for more than a year now). So, I have to trust the rest of you on this kind of issue. But, I don't take MG as authoritative, again, because it predates some important capabilities and some open/close-related semantics changes as a result. I don't need my docs for that.
Dave G. can speak to this likely better than I, Dave L., but open and close semantics are different; that was the subject of the recent discussion "Opinions, please" that he started. When the docs say that the driver open is called for each stream open, but close is called only for the last close, it may be referring to that aspect. But that doesn't preclude the last close from being two routines, each to be called, for the read and write queues resp. I.e., there is possibly an ambiguity here. I'm not trying to resolve it, but as in that case, I am doing what I can to identify it.
You may have a good point, though, Dave L., that if there are two different open routines, maybe both should be called. Another possible ambiguity. I just don't want us all rushing to judgement, and leaving LiS less flexible than it should be as a result.
My opinion is that when reading documentation meant not for implementors but for users, the implementor _must_ find and follow the broadest possible reading, not the most narrow. The authors weren't likely writing to be as precisely followed as an implementor needs, but to be as easily understood as a user needs.
So, Brian, with all due respect to you, I think you have good points, but I also think your reading is too narrow, and thus has the effect of limiting flexibility. I try to avoid that when I can; you certainly don't have to avoid it, though, if you don't want to. We obviously make our implementation choices with different criteria in mind.
-John
Brian F. G. Bidulock wrote:
John,
One more point on this:
If the read close routine wants the write close routine called, it can call it itself before returning:
int xxx_close(queue_t *q, int oflag, cred_t *credp) { ... ... return WR(q)->qi_qinfo->qi_qclose(WR(q), oflag, credp); /* or even more directly xxx_wclose(WR(q), oflag, credp) */ }
So it really makes no sense for qdetach to be calling it in any event.
--brian
On Fri, 10 Oct 2003, Brian F. G. Bidulock wrote:
John,
On Fri, 10 Oct 2003, John A. Boyd Jr. wrote:
Dave G. - how about checking to see if they're the same, if both are set, and if they are, call only one? But otherwise, call whatever is set, which may be both?
I agree with you otherwise, though; I'd prefer to leave it as is.
Why? When it goes against documented STREAMS behavior?
On the other hand, what about qi_qopen()? Why are you not calling both qopens? One with the read queue pointer and the other with ther write?
Because its not done that way, of course. And what is true for qopen() is true for qclose() in this case.
--brian
-John
David Lehmann wrote:
David Grothe wrote:
David:
I think I see what is going on. Consider the following lines from the trace:
...
Queues come in pairs. This loop is examining each queue of the pair and calling the close routine for whichever queue has a pointer to a close routine. Apparently your qinfo structure for your module has a pointer to the close routine for both the read and write queues. It is conventional to only provide open/close routine pointers for the read queue.
I think if you change your qinit structure the problem will go away.
Maybe so, but this is the same code that Solaris uses. My understanding is that close should be called once and only once for the queue pair. Maybe you should take John's suggestion and set do_close to zero after executing the close routine once.
_______________________________________________ Linux-streams mailing list [EMAIL PROTECTED] http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
-- Brian F. G. Bidulock � The reasonable man adapts himself to the � [EMAIL PROTECTED] � world; the unreasonable one persists in � http://www.openss7.org/ � trying to adapt the world to himself. � � Therefore all progress depends on the � � unreasonable man. -- George Bernard Shaw �
_______________________________________________ Linux-streams mailing list [EMAIL PROTECTED] http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
_______________________________________________ Linux-streams mailing list [EMAIL PROTECTED] http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
_______________________________________________ Linux-streams mailing list [EMAIL PROTECTED] http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
