Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [multithreading]

Multithreading allows multiple threads to exist within the context of a single process sharing same resources but are able to execute independently.

Filter by
Sorted by
Tagged with
0 votes
0 answers
31 views

Splitting world data between multiple threads in C++

I'm currently working on world management system for my multi-threaded game engine in C++. The problem I'm facing right now is synchronizing world data between main and render thread. The current ...
xarxarx's user avatar
1 vote
2 answers
103 views

Making a game loop to run multiple threads

I'm having a really hard time understanding Threads and their contents. What I'd like to have is a main game object (which I have) and a loop, where I can measure the time it takes for two threads to ...
Valtsuh's user avatar
  • 79
0 votes
0 answers
46 views

Multithreading Chunkbuilding - Thread.Start() acts as it is on the main thread

I'm building a game from scratch using OpenTK, in C#. It is in its base form a mesh-based voxel engine. I have a decent startup on the chunk building algorithm, multiple blocks, block data, etc, but ...
Pale_Gray's user avatar
1 vote
2 answers
180 views

Bullet Physics Multi-threading Rigid Body transform jittering issues across threads

I've been working on a game using Bullet Physics for C++ as well as SDL for the windowing (with OpenGL) I've recently threaded the game, so that a separate while loop runs the Physics Simulation, ...
jasonmzx's user avatar
1 vote
0 answers
33 views

Physics interpolation given an asynchronous physics thread

I've followed https://gafferongames.com/post/fix_your_timestep/ to do interpolated physics. I have a separate thread entirely from my graphics thread. I use vulkan which allows me to do asynchronous ...
Krupip's user avatar
  • 1,763
0 votes
1 answer
89 views

How to setup a loading screen using SDL_Threads?

I am trying to set up a basic toy example of how a loading screen would work in SDL. Here is my code below. ...
lancen's user avatar
  • 33
0 votes
1 answer
266 views

Should networking and rendering be separated in multiple threads?

I've been trying to code a multiplayer client/server prototype game using SFML's networking. My server and client use TcpSelectors to wait for a certain amount of time for incoming packets without ...
xGolden's user avatar
0 votes
1 answer
150 views

Render and Process loop synchronisation with threads

I am developing an interactive visualizer for a project using Pangolin and OpenGL. The idea is as follows. There are two threads: 1. Render Thread 2. Process Thread - acquire lock and swap ...
Nitron_707's user avatar
1 vote
1 answer
328 views

How would you write a multithreaded gameloop in C++20 (+) or C++/WinRT?

What are the pros/cons of using either C++20 std:async or C++/WinRT's asynchronous thread and messaging support? What would the code look like when implementing multithreaded game-loops that ...
elika kohen's user avatar
0 votes
0 answers
381 views

Message pump and D3D11 DXGI in separate threads

I have read: https://learn.microsoft.com/en-us/windows/win32/direct3darticles/dxgi-best-practices#multithreading-and-dxgi https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/d3d10-graphics-...
Peter's user avatar
  • 1
1 vote
1 answer
181 views

Multithreading in extra large MMO worlds

How is a gameworld of super large size handled? I was always wondering how games handle large MMO worlds. Until now I thought that separation of areas was the key for games like World of Warcraft. In ...
plomba's user avatar
  • 13
0 votes
1 answer
65 views

Any way to copy data into a component in another thread?

Pretty sure the answer to this is a resounding no but just in case... Running an expensive algorithm in a separate thread. However, it returns data that must be copied into the arrays of a Shapes....
arcadeperfect's user avatar
0 votes
1 answer
1k views

How to use Unity job system to do background work spanning multiple frames?

I have a slow level generation algorithm that freezes the main thread when it runs. I found this post which is exactly the same problem, but predates the Jobs system. All the jobs examples I found are ...
arcadeperfect's user avatar
0 votes
1 answer
447 views

Python GLFW and PyOpenGL: How to update a VBO from a thread while rendering at the same time

I'm really new to this community. I'm sorry for any mistakes in advance.I'm making a game like minecraft with GLFW and OpenGL. The problem is, I just can't render a VBO while I update it from another ...
N3RDIUM's user avatar
  • 53
1 vote
1 answer
1k views

Using Unity Jobs to encode file to PNG and then save it on Main Thread

I have a following code , and i can not retrive encoded Output from Job. If I Use JOB : The result is not a valid png file. What I get is a 67,2 MB file which can not be opened with any image editor ...
Corvus Ultima's user avatar
0 votes
0 answers
93 views

What's a good architecture for a simulation?

I have a concept that involves a world being simulated. Lots of entities and processes acting upon them, not to mention interactions, etc... Every SimulationTick, ...
Basic's user avatar
  • 1,278
0 votes
0 answers
197 views

What is the most performant way for a game engine to poll gamecontrollers?

I am working on a game engine, and currently I hesitate on this decision. I developed a library that allows Dualsense and Dualshock4 devices to be used in the engine. XBox Support is made possible via ...
broken-bytes's user avatar
0 votes
1 answer
553 views

How do game loading screens work?

I have successfully developed a 2D game. I display sequential introduction images then load the start screen after that of course I load the game level in a single thread, it is a basic functional ...
D.elp's user avatar
  • 103
1 vote
1 answer
378 views

Wait for a function to return value without impacting framerate

I'm looking to do some possibly heavy calculation in my game. An agent in my game needs to evaluate up to 1000 objects while performing heavy calculations to select his next job. I want to either ...
caleidon's user avatar
  • 571
0 votes
0 answers
151 views

ECS multithreading without value types?

Im working with an Java based ECS framework called "Artemis ODB". Its great so far but it lacks multithreading or jobs. So i wanted to add them by myself. I actually wanted to give each job ...
genaray's user avatar
  • 517
1 vote
0 answers
104 views

Advice on Multi-Threading Vertex Buffers in Vulkan (or any api)

I have managed to multithread everything in my voxel engine besides two vkCmdCopyBuffer() calls that constantly update a single massive vertex and index buffer using an array of thousands of regions, ...
Tristan367's user avatar
0 votes
1 answer
254 views

while(1) in separate threads. safe and efficient

In my TCP multithreaded server written in C, I have multiple threads with infinite loops checking for new inputs from thread safe queue and then doing their jobs. pseudocode: ...
user154155's user avatar
1 vote
1 answer
525 views

Multithreading vs Asynchronous game loop for multiplayer online game?

I'm trying to create a turn based multiplayer online game where players can be grouped in a room/lobby and play (similar to Ludo but number of players can be more than 4). There can be multiple such ...
Kaushal28's user avatar
  • 111
0 votes
2 answers
1k views

How to process events as well as do OpenGL rendering using multithreading?

I am working on a very complicated graphics rendering, using OpenGL, and it is very time consuming, in the sense that it creates a delay in the event handling, of my application to an extend that, the ...
Aravind A's user avatar
  • 103
-1 votes
1 answer
155 views

Parallel transformations tree update

I create my own pet-project graphics engine for the learning and research purposes. Now I'm trying to create a more efficient scene transformations update technique. My current approach is the linear ...
FoxCanFly's user avatar
3 votes
1 answer
3k views

Question on parallelizing ECS Systems

Learning & Implementing an ECS system for my game, I'm wondering how I am supposed to parallelize the systems on multiple threads. Different systems can't run at the same time (unless they operate ...
yggdrasil's user avatar
  • 131
0 votes
1 answer
245 views

Should a server run all maps in one loop, or a thread/game loop per map?

I'm working on a real time multiplayer browser-based game. The game is top down on variable size tile based maps. There is no central map where all players come together, the entire game plays out in ...
sushibrain's user avatar
1 vote
1 answer
164 views

Multithreaded callback

I'm making a multiplayer game where players fight in vehicles, and I am doubting my server architecture. As it will be physics, network and AI intensive I would like to split these 3 topics into their ...
AnnoyinC's user avatar
  • 198
0 votes
2 answers
453 views

Running multiple game servers on single host

I want to use a vps/dedicated server for game hosting. I expect hosting a lot of servers on that. For the connection, should I assign a unique port for every server or change IPs for every server. And ...
CoolingJam19341's user avatar
0 votes
1 answer
430 views

How can I handle hundreds of calculation heavy nodes at the same time?

I'm currently trying to implement a basic boids simulation with godot in c#. Currently I managed to implement evasive behavior which works fine for a boid count of roughly 300. Everything beyond that ...
Crude Code's user avatar
0 votes
2 answers
548 views

is unity DOTS mature enough to build a whole project on it? [closed]

maybe you assume this question opinion based but its not. please read the whole question. the question has 2 aspects. are all features implemented? just better say, can i do everything or any ...
virtouso's user avatar
  • 2,628
0 votes
1 answer
886 views

Is Dedicating A Thread To Inputs A Good Idea In Game Design?

Say I design my game targeting a specific PC to run it on 120 frames per second. And say I need to get Input data from the controller at a frequency of 800 times per second, and feed that input data ...
Physician's user avatar
  • 101
1 vote
2 answers
1k views

How would I optimize that piece of code using Unity?

I'm doing filtering on a depth image and I would like to convert that piece of code into job system of unity, because it's so slow. The image update is called each frame ...
Andre Ahmed's user avatar
2 votes
1 answer
889 views

How do multiplayer servers handle receiving, handling, and sending packets?

I want to make a fighter jet simulator game. The server (authoritative) and client communicate over udp. The server sends out updates about the gamestate at a fixed rate. Think of plane positions, ...
AnnoyinC's user avatar
  • 198
11 votes
2 answers
14k views

Should I use Async & Await, instead of Coroutines, in Unity?

Should I use Async & Await in Unity? Or should I keep using Coroutines? If I should use Async & Await, how can I do so in a manner comparable to Coroutines?
Evorlor's user avatar
  • 5,793
0 votes
1 answer
66 views

Unity: How to connect to server with status in dialog

I am trying to build in unity a basic logon screen. Now I'm building on something if the connection will have delay or so... There will be a dialog, where the progress of connection to server will be ...
Zechy's user avatar
  • 67
1 vote
0 answers
91 views

Binding Lua Function to Perform tasks using std::async

I am trying to load a bunch of mesh resources in the format of .obj files. Some of the files are very high in poly count so when loading using the below method It takes more than 10 seconds. I would ...
JJerome's user avatar
  • 11
2 votes
1 answer
1k views

In Unreal why is it safe to access a UTexture2D's properties from the render thread despite the documentation stating this is not allowed?

I've been trying to implement something that will update textures on the render thread from a background thread. And from what I've read of the unreal engine documentation you should never access a ...
J. Rehbein's user avatar
2 votes
1 answer
3k views

Multithreaded design for a game server

I would like to start developing my own game. Basically, the game has a "world" that players can travel around and modify. Think of it as a much more realistic version of Minecraft or an open world ...
Java Developer's user avatar
0 votes
1 answer
114 views

Box2d: crash on createBody in beginContact callback

I am getting this error on creating body in contactListener ...
Shubham Agrawal's user avatar
0 votes
1 answer
333 views

Worker threads are not being utilized in Time rewind system, is this job system really multi-threaded?

I am trying to make a simple time rewind mechanic. It's working but it becomes slower as number of game objects increases. I decided to give Job System a shot. My idea is to interpolate between ...
videogamechef's user avatar
0 votes
0 answers
236 views

Help deciding data structure for spatial partitioning, using only value-types in c#

I simply want to implement some sort of grid where I can sort units in an RTS into cells, and then for each unit check to avoid other units and attack other units, in 2d. My map grid is currently 10 ...
Tree3708's user avatar
0 votes
1 answer
166 views

Managing large amounts of data and processes for an economy management game

I'm making a management game in the vein of Anno or Stellaris, but I'm unsure how to manage all my data efficiently. Short example: the player controls multiple islands. Each island has factories on ...
J. Doe's user avatar
  • 11
0 votes
0 answers
79 views

How should I cycle my game to be more scalable?

I'm trying to improve my game emulator so it can handle more users. I currently have one separate thread and execute all processing there. The cycles processes players and rooms, rooms are individual ...
Ash Ketchum's user avatar
0 votes
2 answers
1k views

Should I create thread for both UDP and TCP?

So I have TCP connection for stuff like leveing, player info, etc..And I have UDP datagram for stuff like player position, rotation, etc..Should I create new thread for both TCP and UDP on both client ...
Vuk Uskokovic's user avatar
0 votes
1 answer
2k views

How to make progress bar in EditorWindow with Threading in Unity?

I need to make a progress bar in EditorWindow. To do this, I perform the function of calculations in threads: Thread thread = new Thread (_worker.Work); thread.Start (); The class itself emitting ...
Ivan Triumphov's user avatar
1 vote
1 answer
1k views

Multithreading: Each system on a different thread or a thread pool?

I'm building a fairly involved game using OpenGL and C++. I've been thinking about how to implement multithreading, and the two options are: 1) Each system (Graphics, Audio, Physics, et cetera) gets ...
Rish's user avatar
  • 181
2 votes
1 answer
940 views

JWJGL Multi-threading to separate update and render

Introduction: I am currently designing a game in Java using the LWJGL 3.0, with Gradle. I have quite an advanced knowledge on multi-threading, and I am aware how GLFW does/doesn't implement multi-...
Kris Rice's user avatar
  • 193
-1 votes
1 answer
325 views

Does SDL_SetThreadPriority work with std::thread

I'm trying to set the priority of my threads so that my UI thread can be given priority over background calculations. I noticed that SDL has a SDL_SetThreadPriority ...
Disako's user avatar
  • 3
1 vote
1 answer
213 views

How to control JavaFX's animations execution order when animations "queue" is being altered in run-time?

What is the proper way of handling synchronization between GUI animations' execution order and the user's dynamic input? More specifically, I would like to know how to enforce some logical ...
Julian Broudy's user avatar

1
2 3 4 5 6