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
1 answer
139 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
81 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
274 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
272 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
147 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
54 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
382 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
87 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,166
0 votes
0 answers
173 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
470 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
345 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
  • 561
0 votes
0 answers
134 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
90 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
198 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
440 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
129 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
2 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
  • 121
0 votes
1 answer
233 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
142 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
374 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
368 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
543 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,588
0 votes
1 answer
674 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_lamothe's user avatar
2 votes
1 answer
696 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
13k 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,775
0 votes
1 answer
64 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
85 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
966 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
110 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
320 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 ...
Ankit singh kushwah's user avatar
0 votes
0 answers
210 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
75 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
1k 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
909 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
868 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
291 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
197 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
0 votes
0 answers
272 views

How to fx low FPS in a single threaded Directx9 3D game

We're having issues with low FPS in a third-person shooter 3D game. This happens when you have too many polygons on screen. The FPS is locked to 60, and the gameplay is fine, but the moment when you ...
ryspbsk's user avatar
1 vote
1 answer
336 views

What's the best practice to use the pbo to upload multi textures?

I have a basic model to upload textures as shown in the following picture. I design this for several reasons: Only the primary thread owns the OpenGL context, so I choose to create buffers, map ...
Sheldon Wang's user avatar
1 vote
2 answers
2k views

OpenGL draw functions and multi-threading. How they work together?

I want to apply multi-thread in a simple way to control and draw 4000 objects. I am using SDL and OpenGL. control : locations, collisions, calculations ... etc draw : OpenGL draw functions ...
Emre Kaya's user avatar
  • 535
1 vote
1 answer
631 views

Calculating distance using Job System

I am trying to find out the distance between game objects and the player position using Job System, But I am getting an error of unsafe pointer race condition. Can anyone tell me how to access ...
paul p's user avatar
  • 380
5 votes
1 answer
2k views

Multithreading MMO Server. A thread per area OK? [closed]

As a personal project, I'm setting up a MMO, and writing the server in C#/.NET Core. As of now my architecture is as follows: The world exists of different areas ( you can go from area to area trough ...
TanguyB's user avatar
  • 161
0 votes
2 answers
939 views

While loop running in thread, but not doing anything [C++]

I am trying to multi-thread my game so that one thread updates and renders the player, while the other listens for inputs. I used a while loop to keep my detached thread running in the background, ...
Priswall's user avatar

1
2 3 4 5 6