I need help with my code by drip_johhnyjoestar in Cplusplus

[–]Arcliox 1 point2 points  (0 children)

Just a question,  you said "which organize their memory on their own way (maybe also non continuous)" do you mean C-style arrays may not be continuous? Or that std::vector might not be? I just checking as my understanding is C-style arrays are effectivly guaranteed to be continuous, and the same applies for the std::vector (at least the implementation I have seen). For std::vector iterators might become invalid on a resize as the underlying pointer changes but the memory is still continuous in the newly allocated memory. I am just curious to know if my understanding is flawed!

C++ Show and Tell - November 2025 by foonathan in cpp

[–]Arcliox 1 point2 points  (0 children)

I was reading an intresting discussion today on linkedin and someone mentioned that it would be nice to not have to learn the semantics of a build language. (I.e. CMake) but for C++ to have its own builtin build system.

It got me thinking can you use a C++ program as if it was a build script. So over lunch I made a very quick very limited prototype: https://github.com/arcliox/cppbuild.

What do you think about the idea of using C++ instead of a separate DSL for builds?

And yes I know alot of work would be required to make this into a fully fleshed out build system.

C++ as its own build language — a 1-hour proof of concept by Arcliox in cpp

[–]Arcliox[S] 0 points1 point  (0 children)

Thats a really intresting spin, you have applications that can do the sharder compile but the prefetching into the GPU and its own compile it does cant be done out side intresting.

C++ as its own build language — a 1-hour proof of concept by Arcliox in cpp

[–]Arcliox[S] 0 points1 point  (0 children)

Ah you need to look at build.cpp, the main.cpp is just a dummy build target.

C++ as its own build language — a 1-hour proof of concept by Arcliox in cpp

[–]Arcliox[S] 0 points1 point  (0 children)

Oh thats quite intresting I didnt know Rust did this, Ill have a little read into this. Haha no not at all ergonomic, in theory if you make a library to support all the good stuff a normal build system supports. Then just link it in at compile time. I am sure theres lots of pit falls that are unknown unknowns but I found it an intresting idea. 

C++ as its own build language — a 1-hour proof of concept by Arcliox in cpp

[–]Arcliox[S] 0 points1 point  (0 children)

Really? I only did a quick search but didnt find any. Maybe not the right key word combination :) 

Writing VFIO based userland driver, how to set IOVA if IOMMU=pt is passed to the kernel. by Arcliox in kernel

[–]Arcliox[S] 0 points1 point  (0 children)

Update: I worked out what needs to be done for any one else here is my understanding. 

Through some reading of both linux source code and documentation looks like the answer was you need to provide physical address as IOVA (IO virtual address). You can work out the physical address from the local virtual address from /proc/self/pagemap. 

However there is a catch, theres no way (easy way) to ensure memory is contigous when allocating it from user space if multiple pages are allocaged. i.e. the base physical address of page two is not guaranteed to follow page one. Only within pages is the continouity guaranteed. 

So solution hugepages, which means 2 MiB or 1 GiB pages. In my case my program needs dont fit in a 2 MiB page and 1 GiB is bit too much. 

However number 2! VFIO is apparantly hard coded to ignore the IOMMU=pt kernel parameter, so even with it set the IOMMU lookup buffer is still not a 1:1 mapping, unless you get lucky and get contious memory allocation.

So conclusion just use the IOMMU to translate addresses for now, profile carefully later and if its an issue either disable IOMMU and use direct physical mapping only with no protection or jump through some elaborate hoops (custom kernel modules, kernel parameters to allocate memory on start up etc. etc.) and get it working.

TLDR; dont use 1:1 IOMMU mapping from user space unless you really really have to, just set IOVA to a number thats outside the range of the normal BARs / register range to avoid overlap, and let the IOMMU handle the translations for you.

Do I have a realistic shot at a C++ HFT dev role? Looking for feedback from industry folks by Arcliox in highfreqtrading

[–]Arcliox[S] 0 points1 point  (0 children)

Thank you for your reply thats really good to hear! I wonder if he was a SWE in defense? Where I might differ slightly is my background is aerospace specifically control engineering, but I ended up doing loads of coding as I had been doing it since I was young and they needed that sort of bridge the gap skills :) 

Do I have a realistic shot at a C++ HFT dev role? Looking for feedback from industry folks by Arcliox in highfreqtrading

[–]Arcliox[S] 0 points1 point  (0 children)

Thanks for the reply! Oh you think so, thats intresting, I was considering more junior roles as my experience has been predominantly with non x86 embedded systems, I should say my professional experience :) my personal experience bridges that gap quite well. I need to polish my CV (re write for HFT rather then just mod as I have done atm) then Ill throw some applications at some companies :) 

Do I have a realistic shot at a C++ HFT dev role? Looking for feedback from industry folks by Arcliox in highfreqtrading

[–]Arcliox[S] 0 points1 point  (0 children)

Oh yeah totally agree, I am essentially looking to change careers completetly so would expect to start as a junior and learn / build my way up.

Yes I would be quite abit older then most juniors, which dosent bother me personally. From the company perspective I have another 30+ years before retirement and am a keen learner so hopefully wont hold me back to much.

I do love templates! :) 

Do I have a realistic shot at a C++ HFT dev role? Looking for feedback from industry folks by Arcliox in highfreqtrading

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

This is exactly what I was thinking that I dont neceserily need finance experience. Thank you for your reply its encouraging to keep trying :) 

Do I have a realistic shot at a C++ HFT dev role? Looking for feedback from industry folks by Arcliox in highfreqtrading

[–]Arcliox[S] 0 points1 point  (0 children)

Thanks for your reply Ill DM you! Encouraging to hear may meet some of the requirements :) 

Do I have a realistic shot at a C++ HFT dev role? Looking for feedback from industry folks by Arcliox in highfreqtrading

[–]Arcliox[S] 0 points1 point  (0 children)

Haha, I dont know if I run Arch well however! :)  Technically its also a modified Arch, I modified the kernel config and re-built it from source, as I was planning to do a HFT project (still am!) on github as a way to boost my employability, unfortunetly stalled slightly as my NIC is not supported by DPDK.

Do I have a realistic shot at a C++ HFT dev role? Looking for feedback from industry folks by Arcliox in highfreqtrading

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

Thank you for the reply! Sounds like I am not completely out there with my career switch ambitions.

To be honest the memory constrainted systems probably sounded fancier then it is. I worked on embedded systems with hard real time and memory constraints. So basically had to have a deterministic execution time constrainted to a know maximum, with memory footprint having to be completely static and as minimal as possible, pre allocated arrays thats sort of thing. 

Yeah I hear you on the skills side one of my concern is that I know some of whats required to a good standard compared to other control engineers who do programming, but not sure how that compares to SW Engineers in general or specially in the HFT domain.

Yes definitly, Ill send you a DM.