mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.1K
active users

#multithreading

1 post1 participant0 posts today

Java exception of the day: FileAlreadyExistsException on

Files.copy(body, requestedFile, StandardCopyOption.REPLACE_EXISTING);

🤷 It is not as weird if we take into account multiple threads. From the JDK code of Files.copy after deleting the requestedFile first:

} catch (FileAlreadyExistsException x) {
... other stuff deleted ...
// someone else won the race and created the file
throw x;
}

#FluidX3D #CFD v3.2 is out! I've implemented the much requested #GPU summation for object force/torque; it's ~20x faster than #CPU #multithreading. 🖖😋
Horizontal sum in #OpenCL was a nice exercise - first local memory reduction and then hardware-supported atomic floating-point add in VRAM, in a single-stage kernel. Hammering atomics isn't too bad as each of the ~10-340 workgroups dispatched at a time does only a single atomic add.
Also improved volumetric #raytracing!
github.com/ProjectPhysX/FluidX

Remember when I mentioned we had ported our #fire propagation #cellularAutomaton from #Python to #Julia, gaining performance and the ability to parallelize more easily and efficiently?

A couple of days ago we had to run another big batch of simulations and while things progressed well at the beginning, we saw the parallel threads apparently hanging one by one until the whole process sat there doing who know what.

Our initial suspicion was that we had come across some weird #JuliaLang issue with #multithreading, which seemed to be confirmed by some posts we found on the Julia forums. We tried the workarounds suggested there, to no avail. We tried a different number of threads, and this led to the hang occurring after a different percent completion. We tried restarting the simulations skipping the ones already done. It always got stuck at the same place (for the same number of threads).

So, what was the problem?

1/n

I think I have finally fixed the last known mysterious crash in my game engine. This one has been stumping me for weeks because I already had checks for the rare condition I thought was causing it, and it turns out I was right. The breakthrough was realizing it wasn't a crash, it was a hang. The checks to exit out of rendering early if a model wasn't fully loaded, were causing it to route around the mutex unlock on the instance. So, it would just hang forever on the next frame waiting to get the lock. "continue;" is dangerous. Two line fix, no more crashes on level load. #coding #debugging #multithreading #cplusplus

Hace unos meses comenté una de las grandes novedades de Python 3.12, que va a provocar discusiones durante años: No-GIL, Free-threaded Python (En CPython). En otras palabras, la opción ejecución de Python en multi-hilos.
A priori parece una gran noticia, que el software se ejecute en varios hilos o CPUs debe ser una mejora de rendimiento y un camino a seguir por todos... ¿tal vez no?
El Global Interpreter Lock (GIL) se ha ido optimizado a lo largo del tiempo, tanto que en ciertos casos el rendimiento es superior a una ejecución multi-hilo. Por otro lado es más sencillo de programar y depurar un programa en un solo hilo que en varios. No es una solución mágica, pero si una mejora en ciertas circunstancias con cierto número de hilos.
De momento tendremos algunos software que les favorezca trabajar con el GIL activo y otros no. Es posible jugar en modo experimental. Los desarrolladores son tan conscientes de sus problemas iniciales, que para poder usarlo necesitas compilar CPython con una flag concreta.
Dicho todo lo anterior, es emocionante ver como ha llegado una característica tan importante y esperada.
#python #cpython #multithreading #gil

Multithreaded CLI developers: let your users configure the number of threads.

Entire classes of use cases are hiding inside that will make your life easier as a dev -- and threads=1 is usually not hard to add.

One example: if your multithreaded tool works significantly faster on a single file when I force your tool to just use a single thread and parallelize it with parallel --pipepart --block instead, then either:

  1. you might decide to develop sharding the I/O of the physical file yourself, or

  2. you might consciously decide to not develop it, and leave that complexity to parallel (which is fine!)

But if your tool has no threads=N option, I have no workaround.

Configurable thread count lets me optimize in the meantime (or instead).

🔧 New Blog Post Alert! 🚀
Struggling with thread contention in your multithreaded .NET applications? 🧵
Learn how to diagnose and resolve thread contention to enhance performance and stability in your projects.

📖 Read more: medium.com/@faysal.malik/diagn

Medium · Diagnosing and Fixing Thread Contention in Multithreaded .NET ApplicationsBy Faisal Iqbal

Have you ever programmed a human computer? Having 30 people walking around the room to exchange information between RAM addresses and CPU registers, and human CPUs execute operations on the clock is a very special experience*.

This week I learned more than in a ~year of self-study, thanks to the 16th Advanced Scientific Programming in #Python aspp.school
We covered version control, packaging, testing, debugging, computer architecture, some #numpy and #pandas -fu, programming patterns aka what goes into a class and what doesn't, big-O to understand the scaling of various operations and how to find the fastest one for the given data type and size, and an intro to #multithreading and #multiprocessing 🍭

A personal highlight for me was pair programming. I never thought writing code in with a buddy would be so much fun, but I learned a lot from my buddies and now I don't want to go back to writing code alone 😅

Very indebted to the teachers and organizers; aspp.school/wiki/faculty if you ever meet one of those people, please buy them a drink for what they have done for a better code karma state in the universe

*our human computer didn't manage to execute the simplest sorting algorithm and the CPUs started to sweat; we experienced what happens when the code is ambiguous and imprecise 😱🫨