Parallel builds in CI/CD are nice and dandy, but one has to remember that having a couple dozen simultaneous jobs update the same file at the same time can lead to undesirable side effects.

#ThreadSafe #CI_CD

getenv() + putenv() + setenv() 的 thread-safe 問題

在「Improving Steam Client Stability on Linux (ttimo.typepad.com)」這邊看到的,原文在「Improving Steam Client stability on Linux: setenv and multit

https://blog.gslin.org/archives/2024/11/13/12063/getenv-putenv-setenv-%e7%9a%84-thread-safe-%e5%95%8f%e9%a1%8c/

#Computer #Linux #Murmuring #OS #Programming #Security #Software #env #getenv #glibc #linux #memory #multihtreading #putenv #safe #safety #setenv #thread #threadsafe #threading #threads

getenv() + putenv() + setenv() 的 thread-safe 問題

在「Improving Steam Client Stability on Linux (ttimo.typepad.com)」這邊看到的,原文在「Improving Steam Client stability on Linux: setenv and multithreaded environments」這邊。 裡面提到了 getenv() + putenv() + setenv() 的設計問題使得他很難 thread-safe 而造成 Linux 版的 Steam client 容易 crash,從功能上大概猜得到原因,畢竟是對一塊 global variable 操作 + 提供 pointer 讓後續的程式操...

Gea-Suan Lin's BLOG
Just realised that the code I wrote which contains a #BufferOverflow if you compile it for a 256 bit CPU is also not #ThreadSafe. Truly I am an awful person.

And what happened? After I had it all working, and I wanted to say, OK, let's use multitasking to share out all the work amongst the available CPU cores?

Remember, I'd put zero thought into trying to make the code #ThreadSafe, I was just writing single-threaded game play, but I *was* using #immutable vals instead of mutable vars.

12/

Thread Safety in C++ and Rust

Lately I’ve been experimenting with Rust, and I want to report some of whatI’ve learned about thread-safety. I am an enthusiastic dabbler in Rust: Ispend mo...