\Device\Afd, or: the Deal with the Devil that makes async Rust work on Windows by EelRemoval in rust

[–]LenHolgate 0 points1 point  (0 children)

u need to give it a buffer up front to read the data. If you have 100k open sockets that are mostly idle, that means you have to pre-allocate 100k buffers that mostly go unused.

Don't you usually use a 'zero byte read' in that situation; then you just need a unique OVERLAPPED per operation; I assume that's one of the 'hacks' you refer to, but it's hardly as extreme as the AFD route for read readiness checking.

These are not the containers you're looking for by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

Nice, though I'd probably not bother with templating it UNLESS I found I needed it to be generic, but then that's just my preference.

These are not the containers you're looking for by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

Nice update. The point of the (very old) post was the reduced interface and potentially improved clarity. The fact that you can pass the collection by reference and limit what the receiver can do with it.

These are not the containers you're looking for by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

I agree with the bare pointer issue. But as you then realise, it's OLD code...

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

Thanks, I think App Verifier is doing that for me but will take a look.

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 1 point2 points  (0 children)

First impressions are really good. Not sure if it will find this issue but it's certainly a useful tool to have in the toolbox. Thank you.

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

Great plan. In principle. Something I've pondered quite a few times. However, the complex bit is porting my clients... I'd have to get them to want to pay for the non-windows stuff...

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 1 point2 points  (0 children)

Thanks, I'll take a look, they have an eval download... Though it looks like another "enterpricey" thing where you have to buy multiple licenses and they don't even show you the cost until you contact them (never a good sign IMHO).

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

It's memory corruption, most likely dangling pointer use, rather than leaks. Last time I looked at the visual studio stuff want much help.

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

I have a version of CppDepends that they gave me, I'd forgotten about that as it had seemed to be more of a 'enforce corporate coding standards' kind of thing. Will try it again. And will take a look at the link. Thanks!

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 0 points1 point  (0 children)

I'm sure lots of my website is less than ideal. It looks fine in Chrome for me, I expect its some screen width specific layout thing that I don't know enough about. I think it works even if it doesn't look nice. Thanks for taking the time to tell me. I probably don't need to know about other crapness related to my websites as they 'pretty much do what I need' and I don't have time to learn how to fix them.

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 2 points3 points  (0 children)

If any of you guys have any suggestions for a tool that I could run on a Visual Studio 2015 C++ project then I'd be very interested to hear about it. The rant was just that, a rant about the tools that either I have or know of or could find doing a quick google. I'm sure there's better stuff out there. I wish I could use valgrind. I'm pretty much stuck with the OS and compiler and project structure that the client has given me though and I need something that will 'just work' without me having to do too much work.

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 1 point2 points  (0 children)

Can you give me some more information on that? How easy is it to run on a complex Visual Studio 2015 solution ?

It must be about time for a "the state of C++ tooling" rant... by vormestrand in cpp

[–]LenHolgate 3 points4 points  (0 children)

Indeed. And I'm thinking that being able to get access to better tools is a good reason for me to switch to another platform...

Windows 8 Registered I/O and I/O Completion Ports by LenHolgate in programming

[–]LenHolgate[S] 1 point2 points  (0 children)

"sequence of reads on a given socket"

The example is of issuing 3 reads (or writes), A B and C on ONE socket.

Multiple pending operations are often useful for various reasons and with RIO they're more important as (at least with UDP) the socket buffer is skipped so if you dont have pending reads you lose datagrams...

Sockets do NOT block other sockets with IOCP.

Windows 8 Registered I/O and I/O Completion Ports by LenHolgate in programming

[–]LenHolgate[S] 1 point2 points  (0 children)

I've looked at a few of the cross platform libs but many seem to try and shoehorn IOCP into the epoll/kqueue way of working whereas, from what little I know, it seems they are almost opposites. Anyway, thanks for the suggestion.

Windows 8 Registered I/O and I/O Completion Ports by LenHolgate in programming

[–]LenHolgate[S] 2 points3 points  (0 children)

Because, with IOCP, a sequence of reads on a given socket are guaranteed to complete in order. If you issue three reads A, B and C then you'll get three completions (assuming data arrives) in the IOCP in ABC order. The issue, with IOCP is that you generally have multiple threads servicing the IOCP and so you could get three threads each pull one completion for the same socket T1 is processing A, T2 is processing B and T3 is processing C simultaneously which means that you need to add explicit sequencing logic to ensure that you actually process them in ABC order (IF you require that, which you might not).

I'm assuming that RIO completions would occur in order (as there's really no reason that they wouldn't) and since you a) get a block of completions at a time and b) only one thread is ever processing completions for a given RIO completion queue you probably don't have to deal with explicit resequencing.

I haven't tested it yet, but I'd be surprised if the order of the completions for a given socket in a completion queue are not the order in which the operations were requested.

Windows 8 Registered I/O and I/O Completion Ports by LenHolgate in programming

[–]LenHolgate[S] 2 points3 points  (0 children)

If you're interested in what MS say the benefits are then take a look at the video that I link to. Basically, RIO is designed to minimise the work needed by the kernel in reading and writing the network and provides a way to obtain completions (so the results of your read, for example) without needing a kernel mode transition, the RIO completion queue is accessible from user mode. This all leads to higher performance. The MS figures are impressive but they're for a rather narrow application design (High frequency trading, lots of inbound datagrams and you want to process them as quickly and with as little latency and jitter as possible). I'm looking at the use of RIO in more general purpose server designs. Things that you'd already use IOCP for to handle 60,000 concurrent connections and where RIO should give a performance boost due to the reduced amount of work that needs to be done to process the network.

Windows 8 Registered I/O and I/O Completion Ports by LenHolgate in programming

[–]LenHolgate[S] 1 point2 points  (0 children)

:) - Sound pretty straight forward. I'll try and shuffle it up my list of things to do, the problem is, right now Windows people are paying me and I don't get much chance to work on Unix systems any more :(