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

learn more… | top users | synonyms

10
votes
3answers
812 views

Efficiently separating Read/Compute/Write steps for concurrent processing of entities in Entity/Component systems

Setup I have an entity-component architecture where Entities can have a set of attributes (which are pure data with no behavior) and there exist systems that run the entity logic which act on that ...
2
votes
0answers
30 views

Is there a way to identify, within a shader, the current GPU thread ID?

My question is rather simple: within a shader, is there a way (that works both in DirectX and OpenGL) to retrieve the ID of the given GPU thread being executed at the given iteration? I am using ...
1
vote
1answer
83 views

Unity3D: Making heavy calculation on separate thread [duplicate]

So, I've created a program with Kinect as its input. As you know, Kinect will send the data 30 frame per second. I have a model that will mimic Kinect's input motion, so on Update() I read the ...
7
votes
1answer
765 views

How to not freeze the main thread in Unity?

I have a level generation algorithm that is computationally heavy. As such, calling it always results in the game screen freezing. How can I place the function on a second thread while the game still ...
3
votes
0answers
62 views

How to await async operations / coroutines?

I'm looking for a generic / reusable way to wait for coroutines and asynchronous operations to finish in Unity 5, similiar to C#5's await keyword. The simplest way I can think of is something like ...
0
votes
0answers
41 views

XNA Access violation from KernelSoundEffectInstance

Some users (but not all) are reporting a periodic crash in my XNA game. They say it's happening every 15 to 20 minutes. I am unable to replicate this myself, so I asked users to send me error logs. ...
3
votes
1answer
852 views

Unity editor stalling on second attempt to play

I am attempting to use a Tobii TX300 eye-tracker as an input device for Unity. This device is connected via LAN (TCP connection managed by Tobii SDK). The Tobii SDK has appropriate methods (I am ...
31
votes
8answers
10k views

How can a game handle all characters at once?

This question is just to gain knowledge about how a game can handle so many characters at once. I am new to gaming so I beg your pardon in advance. Example I am creating a tower defense game in ...
3
votes
1answer
63 views

Locust Swarm algorithm for path finding (devour and move on)

I need to model a locust swarm that devour food stacks and move on to next stacks. I searched for articles and found few articles. These papers is about optimization applications but I want to convert ...
-2
votes
1answer
71 views

Is there any limit to the amount of threads you can run at the same time? [closed]

So i have a decent CPU with 2 cores and 4 threads, Will that effect the number of threads i can allow my program to run simultaneously? In my case, im using a thread for each player on a server.
0
votes
1answer
108 views

Is it safe to set Lua Table data from multiple C++ threads?

As the title states. I'm curious if it's safe to set data in different Lua tables that exist in the same lua state. From multiple C++ threads. I'm asking this because my current system actually has a ...
0
votes
0answers
26 views

In Cocos-2d-x, is there a way to get a shared OpenGL context for use with background loading

We are using parts of the Cocos-2D-X engine and we have a background loading thread which loads textures in the background. Is there a way to get a ShareGroup so we can safely bind an OpenGL context ...
0
votes
0answers
40 views

Multithread OpenGL to Upload Meshes

My game is rendered in dynamically generated chunks, each of which has its own mesh. Every time I generate a chunk and upload its mesh, there is a huge lag spike. Is there a good way of eliminating ...
1
vote
1answer
95 views

Can you use a standard multi-thread if only reading unity objects?

First of all I know about coroutines and how to use them (they're awesome). A friend of mine was telling me about the way the he implemented his saving system in a game he was working on, after ...
0
votes
0answers
34 views

Trouble with OpenGL on OS X

I'm creating an OpenGL-based game for OS X using Xcode. Everything renders correctly when I run the game in debug mode. However, running the game in release mode shows just a blank white window. This ...
0
votes
0answers
52 views

Merging OpenGL rendering result with other graphical elements like user interface. Concepts

For my application, there are several elements drawing: An user interface elements, and several libraries for rendering part of the content of the window. Lets imagine some kind of Google Earth where ...
1
vote
0answers
36 views

Multi-threading for rhythm game?

I'm trying to recreate a rhythm game. However trying to get the key-presses with SDL2 I ran into the problem, that you can only get an event every time a frame has been successfully rendered (I can't ...
2
votes
4answers
424 views

Is it a good idea to make most actions in a game driven by simple tiny threads (in Java)? [duplicate]

I'm thinking of for example making the jump action of a character, that takes ~1s, a distinct runnable, so then other threads can read its state, with additional control over the action itself by the ...
2
votes
1answer
86 views

UDP server and two clients

So - my whole knowledge comes from google and stackoverflow. I'm trying to create an UDP server (with two slots per new instance of the game) and clients. My problem is here that I totally don't know ...
1
vote
1answer
54 views

computationally Intensive routine, ThreadPool or new Thread?

I had to write a computationally expensive routine that runs in 20-30ms. This routine cannot run in the main thread since it would kill the frame rate. The routine runs on demand, when some data ...
3
votes
2answers
874 views

What threading strategy does a game like Transport Tycoon use? [closed]

Transport Tycoon is a simulation game where you control a transport company, place railroad tracks and trains, airports, bus depots, boats etc. Now the game is about 15 years old and I remember ...
2
votes
0answers
59 views

Putting each animation on a thread

I'm trying to make my game as friendly to multi-core as possible. as such, i'm putting each animation on a new thread. I was hoping someone could check out my proof of concept code in java; an ...
4
votes
2answers
55 views

Threading/Streaming files while rendering the scene

I am writing a game engine and am trying to wrap my head around data streaming while rendering. What I mean by this is being able to load resources (however slow it may be) while rendering and not ...
1
vote
2answers
209 views

Async loading in libGDX to set the screen

I would like to bring up a loading screen, for this would make the load async. How can I do this? I looked on the libGDX website but I do not understand very well, maybe because of my poor English. ...
12
votes
5answers
5k views

Synchronization between game logic thread and rendering thread

How does one separate game logic and rendering? I know there seem to already be questions on here asking exactly that but the answers are not satisfactory to me. From what I understand so far the ...
2
votes
2answers
269 views

RTS combat system

I am developing a small-scale TB/RT Strategy hybrid, not unlike the Total War series. It's in the classic medieval setting, with only melee infantry combat currently implemented for testing. Units are ...
4
votes
1answer
223 views

Unity3D multi-threaded data importer?

Goal I would like to be able to separate all my data file readers from the main thread and balance the load over multiple frames. The idea being that while the data is being read/parsed/filtered I ...
5
votes
1answer
121 views

Is locking required to implement a seperate rendering thread?

I kept reading a lot about this, but still not sure about a proper way to implement an independent render thread (variable timestep) running parallel to a physics thread (smaller, fixed timestep). ...
23
votes
4answers
6k views

Is it normal for a game to use 100% CPU?

I just implemented multi-threaded input handling in my game engine where the code that polls the OS to gather input from it and time stamps them is in a separate thread and each frame in the main ...
3
votes
1answer
196 views

How can I exploit multithreading in collision resolution?

I'm trying to speed up my collision resolution by using multiple threads. I'v read through Box2D's source code and while it was challenging and educating, it didn't really point me to how I could use ...
1
vote
1answer
218 views

Resource streaming with job threading system

I am currently researching resource streaming for my current game engine. To add a bit of context, I am doing a contiguous world for a Baulder's Gate style CRPG. So while the camera is usually looking ...
2
votes
2answers
129 views

If IDXGISwapChain::Present blocks, does that mean I'm GPU bound?

I updated my DirectX11 renderer to render on multiple threads using deferred contexts. Before my change, the Present method took a negligible amount of time (according to VTune analysis). After my ...
1
vote
0answers
131 views

What LuaJit threading archietecture should I use?

I am in the process of designing my own Game Engine for use in a real time CRPG - think Baulder's Gate. I know most of my specifications right now, and I am currently in a planning phase. I chose Lua ...
0
votes
1answer
70 views

Delay between bullets java - new Thread

Let's say that I have a cannon on the bottom of the screen that shoots balls to the click direction. I also have some collisions algorithms and here comes the problem. I am trying to implement an ...
6
votes
1answer
722 views

Multithreaded Game Loop

I'm trying to implement a multithreaded game loop. I already did that but had to use a few locks for that, which ruined the performance. After researching a bit I came up with this idea: Instead of ...
0
votes
2answers
2k views

Websocket server thread per connection

I'm creating an html5 multiplayer game and am looking at how to create a websocket server. I've been looking at various libraries and one thing I noticed is that each one will create a new thread for ...
2
votes
2answers
237 views

Instantiation of a GameObject not working for a threading reason

I receive the following error "INTERNAL_CALL_Internal_InstantiateSingle can only be called from the main thread." "Constructors and field initializers will be executed from the loading ...
73
votes
8answers
21k views

How many threads should I have, and for what?

Should I have separate threads for rendering and logic, or even more? I'm aware of the immense performance drop caused by data synchronization (let alone any mutex locks). I've been thinking of ...
0
votes
0answers
94 views

OpenGL, Multithreaded loading/streaming of data

I've thought about how i could implement loading of data in a second thread for two reasons, first, so i can show a nice loading-screen with progressbar and second, for openworld streaming. I came up ...
1
vote
4answers
147 views

OpenGL calls from a different thread?

I understand OpenGL is not thread-safe, but at the same time, Google seems to be giving me mixed responses. I have a LibGDX game that functions normally, UI/rendering/logic on the same thread, ...
1
vote
1answer
48 views

Multithreading in Gamedevelopment, specifically Networking

Let me quick explain my actual setup: I use 2 Threads, one for networking and one for the main-loop (input, update, render). I have two synchronized queues, one for mainthread->networking and one for ...
0
votes
0answers
262 views

AttachThreadInput and PeekMessage Threading

I have a problem with AttachThreadInput and PeekMessage from User32.dll while multithreading. PeekMessage is not returning true in any case. I am designing a Windows Form that uses OpenGL rendering ...
-2
votes
2answers
455 views

Multithreaded or Thread pooled server for real time multiplayer games? [closed]

So if the Thread pool handles 10 players out of 100 per second, this could make a delay that will be no good for real-time games, so as I see it that MultiThreaded will be better, thus it will handle ...
0
votes
0answers
70 views

Texture Editing with Multhi-Threading

So I have this giant Texture2D(4096 * 4096, don't ask why) and all its data stored in an array of Colors. When I hit left MouseButton I create a blue 64 by 64 square at the cursors position using the ...
0
votes
1answer
175 views

Task vs Thread with execution queue [closed]

My game server will have to respond to requests very often, so I consider threading a good option. But should I use Task class from .NET or have several threads that would execute requests which I ...
0
votes
1answer
136 views

XNA Starting a parallel Thread during a draw loop is slower than doing the same task in the main thread in update loop

I'm using XNA and all of my drawing is done in the main thread. I am CPU-bound and I thought I could gain performance by moving some non-update logic (like animation update) from the update loop into ...
1
vote
2answers
853 views

Decoupling rendering pipeline (for UI responsiveness): Multithreading and multiple contexts?

Warning! Wall of text (see <TL;DR> paragraphs below for short version) I have been noticing something in quite many games (most recently in cutting-edge RTS games such as Uber Entertainment's ...
0
votes
3answers
524 views

How can I access LWJGL's Keyboard from a thread other than the graphics thread?

I'm loving LWJGL, but have been running into a number of odd problems with it. Most of it seems to deal with the fact that OpenGL is a state-machine and was only ever meant to be accessed from a ...
0
votes
1answer
995 views

Communication between Box2D and libGDX Stage (Scene2D) running in separate threads

I'm making a physics based 2D game using libGDX and Box2D. I want to move the execution of the simulation out of render thread. I use immutable messages and the BlockingQueue to pass the information ...
1
vote
2answers
211 views

Application of classes with critical non-static fields in LWJGL [closed]

I'm going to be as specific about this question as I can. Ultimately, how is it that I apply a class that uses non-static fields in LWJGL? More specifically, I know that OpenGL is quite nearly more a ...