Reply to post: Re: On speed

Rust marks five years since its 1.0 release: The long and winding road actually works

bombastic bob Silver badge

Re: On speed

yeah C++11 - I think I remember looking at that, STL support for threads (googled just now, saw it - yep). But I'm not an STL fan for a number of reasons and since I've been doing it "the old way" before threads were 'cool', I just continue to do it the way I always have. And, like I mentioned before, I sometimes run into "some standard library" doing things the WRONG way, and end up using my own code to fix/workaround their bugs/features.

For trivial things, using the pthread lib in Linux or 'CreateThread()' in windows is pretty straightforward. Most simple threading things would just translate the STL thread stuff into that inline and 'no difference' in performance. So if I saw it in someone else's code I'd just leave it as-is. But there are cases, especially when background tasks are being done, etc. or the "thread pool" you mentioned (something I might use in a 'work unit' manager object), when waiting in idle state, Linux, FreeBSD, and Windows all have the same problem, of spinning CPU at 100% if you don't explicitly enter some kind of wait state within the kernel, and that usually involves a synchronization object or an explicit time delay.

And, last I looked, Windows 10's TIFKAM/UWP system is guilty of having this very problem. You can see it during application start when two TIFKAM/UWP applications are trying to exchange info for some reason. Maybe this has been fixed, but last I checked it wasn't... (and so my point about rolling my own solution that uses my own experiences to avoid such problems and avoid arguing about validity of pull requests that would fix it but for some reason do not get approval).

It might be interesting to try and repro this problem with two Rust applications.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2021