-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimization, general questions #86
Comments
Perhaps. But like I wrote earlier, there is some years since I wrote that. But I remember experimenting and porting various to Watt-32 programs (like ncat, netperf), and others involving BTW, currently,
A native socket cannot store more than 1 pointer. The problem is that a native socket can be associated with Lines 64 to 75 in 70d84f2
The upper layer The flow for letting
It's rather messy, I know. Even more so when it comes to And BTW, it took my brain almost an hour to dig up all these details after these years.
Correct. Try it with:
Works kinda if you replace |
O(1) is still N times faster than O(N). But you're right, it does depend on scale.
Somehow I was under the impression that it was the other way around (multiple native raw sockets per BSD socket). Don't know where I got that idea now. So there is one native raw socket that broadcasts to all raw BSD sockets? And for the more common case (TCP/UDP), there is always a 1:1 mapping from native to BSD, right? Maybe ideally you'd want a hash table for TCP/UDP sockets and linked list for raw sockets. Now that gets messy. |
AFAICR, for TCP yes. For UDP, I'm not so sure. |
Was wondering, why does the BSD interface call |
It does a lot of things. First, when Lines 1239 to 1245 in 5363dff
the opening Second, It also drains Finally, it handles window update, slow start, Karn Count, and retransmission stuff. It's rather messy.... |
I see, there's a lot going on there. But normally that is on a timer ( I thought, if it is only to speed up ARP resolves, it could be more efficient to add a callback from pcarp.c back to pctcp.c. |
Hi,
While working on the recent PRs I noticed there could be some room for optimization. I'm looking into that now but I had some questions:
Callbacks from the native to BSD layer have to iterate over the socket list and find the appropriate BSD socket. Seems it would be better to store a pointer from the native socket back to the BSD socket that owns it. But maybe there is some reason why you hadn't done that?
I do see for the ICMP callback:
Watt-32/src/socket.c
Line 1845 in 70d84f2
Is that still true? I don't see how it's possible. One BSD socket can only "own" one native socket, no?
I did see you had the idea once to store the
Socket*
s in a hash table. I finished the implementation for it now, but as long as there is so much iterating going on, it wouldn't be any faster.Also I was looking into optimizingselect_s()
/poll()
. I seeselect_s()
has code to check DOS FDs too, but currently it will skip those and seterrno = ENOTSOCK
. So which is it? Shouldselect_s()
be able to work with DOS FDs? It would simplify things a bit if it didn't.Edit: didn't see the check for
SK_FIRST
. So stdin/stdout/stderr should be allowed.The text was updated successfully, but these errors were encountered: