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

5
votes
1answer
65 views

Check if thread has OpenGL context

I'm looking for a way to check if a thread accessing a namespace function has a OpenGL context attached to it. I have looked around and all I can find is, GLFWwindow* glfwGetCurrentContext(); Which ...
2
votes
0answers
37 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
100 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 ...
5
votes
0answers
117 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
46 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
72 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 ...
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 ...
-2
votes
1answer
72 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
146 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
41 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 ...
0
votes
0answers
69 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 ...
0
votes
0answers
37 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 ...
4
votes
1answer
116 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
1answer
115 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 ...
1
vote
1answer
55 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 ...
7
votes
1answer
2k 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 ...
2
votes
0answers
63 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
63 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 ...
2
votes
2answers
291 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 ...
2
votes
2answers
351 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. ...
4
votes
1answer
251 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 ...
3
votes
1answer
261 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 ...
2
votes
2answers
147 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 ...
2
votes
1answer
317 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
1answer
94 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 ...
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 ...
1
vote
0answers
201 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 ...
5
votes
1answer
127 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). I'...
0
votes
1answer
72 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
831 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 ...
2
votes
2answers
284 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 ...
0
votes
0answers
109 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
194 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
50 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 ...
-2
votes
2answers
577 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 ...
1
vote
1answer
80 views

Texture Editing with Multi-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 cursor's position using ...
0
votes
1answer
187 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
153 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 ...
0
votes
1answer
658 views

Unity - Proper use of threads with procedural generation

I have been working on a simple chunk based terrain generation system, with voxel octrees. The overall method works pretty well, but testing this system with large amounts of chunks completely freezes ...
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
497 views

What are the implications of using multiple OpenGL Contexts on a single thread?

I'm trying to integrate two third-party OpenGL rendering pipelines into the same application, namely Cinder's OpenGL API for 3D drawing and backbuffer rendering, and Google Skia's API for 2D drawing. ...
0
votes
0answers
355 views

Android: Asynctask causes ANR (very) intermittently

I'm doing some work on an AsyncTask (creating game objects, loading resources etc) while displaying a static splashscreen. The problem is that every now and then, the AsyncTask doesn't run and the ...
1
vote
1answer
172 views

Synchronization with game tick

I'm working on a multiplayer game and it's currently set up like this. It accepts packets from the client on the fly and does whatever processing it needs to. There is also a main game tick which is ...
1
vote
3answers
92 views

c - Starting an user defined function after the current one ends

The game I am creating displays a menu before starting, the user may select to start the game, or do some stuff. When the user selects an option, I need to call another function which actually does ...
0
votes
1answer
328 views

DX11 Reusing Command Lists

My team is working on an engine implementation and we are trying to add multithreaded scene traversal for updating and rendering our components... The question has come up as to whether or not we can ...
0
votes
0answers
337 views

Android game programming seperate game logic thread from drawing thread

Ok so I want to know what is a proper way to create a multi threaded game. What I have tried is implement a wait and notify between the game logic thread and the drawing thread, but I believe this is ...
-2
votes
1answer
9k views

Games able to use 4+ core CPUs properly [closed]

Are there any games that can really benefit from use of quad core CPU instead of two-core one like Intel Core i3 4340 vs Intel Core i5 4590 Basically they are quite similar in terms of frequency/...
6
votes
2answers
5k views

Update and render in separate threads

I'm creating a simple 2D game engine and I want to update and render the sprites in different threads, to learn how it is done. I need to synchronise the update thread and the render one. Currently,...
0
votes
1answer
463 views

Nullpointerexception when loading resources in openGL ES 2.0 Android project

Overview My splash screen starts by display a 'loading' dialogue and then kicks off an asyncTask (The loading dialogue is derived from the standard Android View class) Within the doInBackground ...