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

16
votes
4answers
4k views

How can I make message passing between threads in a multithreaded engine less cumbersome?

The C++ engine I'm working on currently is split up into several large threads- Generation (for creating my procedural content), Gameplay (for AI, scripts, simulation), Physics, and Rendering. The ...
1
vote
0answers
223 views

Separating rendering and logic thread in GLFW? [closed]

I want to separate my rendering thread (the main thread) and my logic thread in my GLFW game. I'm new to the concept of threading inside games. How would this be done? GLFW isn't thread safe so it ...
1
vote
1answer
342 views

GLES2.0 3D Android game performance and multi threading the update?

I have profiled my mixed Java\C++ Android game and I got the following result: As you can see, the pink think is a C++ functions that updates the game. It does things like updating the logic but it ...
2
votes
1answer
285 views

Displaying animations during loading screens

Games like Karateka (which uses UDK) seem to be able to asynchronously load GL assets as well as display animation. The splash is incredibly short, then presumably their glView shows up. I can think ...
2
votes
1answer
243 views

MVC with looping view

For our school project we'd like to develop a game using the MVC pattern. We're all moderate new java programmers and absolutely new in game development. With our current view (containing only menu) ...
2
votes
1answer
645 views

Separate renderng thread in Android (OpenGL ES 2.0)

I'm used to mainly working with the Canvas SurfaceView API on Android and have recently been learning openGL ES 2.0 With canvas I know that surfaceView gives you the ability to start a new thread to ...
2
votes
2answers
597 views

How can I control the frame update rate of a thread?

I'm building a small game for a college project. It's quite a simple game. There are a number of dots on the screen and the player has to select them in a specific order. It's kind of a "join the ...
7
votes
1answer
497 views

How wise is this multithreading architecture?

I'm rewriting a game engine I wrote in an attempt to parallelize as much as possible. I'm considering making properties which may be accessed from multiple threads all use accessors which use boost ...
5
votes
3answers
274 views

What operations should be multithreaded?

I wonder what game operations should be multithreaded, and which should always run on the main thread. The most expensive operations I could come up with are: loading a level loading resources (for ...
6
votes
2answers
2k views

Mixing threads and coroutines in Unity3D Mobile

I had a coroutine in Unity3D that downloaded a zip from a server, extracted it to the persistent data path, and loaded its contents into memory. The flow looked something like this: IEnumerator ...
2
votes
1answer
313 views

Synchronizing input, update and rendering threads

How do you synchronise the input-handling, state-updating and rendering threads? If a sprite position is modified due to input, the wrong position of the sprite might be drawn to the screen if the ...
3
votes
2answers
477 views

Implementing multithreaded loading screens

Ok, I have fairly little multi-threading experience, but i have done a similar thing before without issue...but this has me stumped. This is in C++, Directx9 Visual Studio... My game basically runs ...
0
votes
1answer
127 views

Receiving server data inside game loop

I'm planning on how my multiplayer game client game loop should work. While I'm convinced that server should be moved from game loop into it's own thread, I'm not sure what should I do about receiving ...
0
votes
1answer
226 views

SpriteBatch.end() Issue because of a thread

While playing, I use a thread to Load() and Unload() Texture2D. I have multiple ContentManager to only Unload() Texture2D I want to unload. But sometimes, I have this issue on the SpriteBatch.End() : ...
0
votes
1answer
155 views

Can threads be used to run resource consuming methods without -ever- freezing UI?

Until recently I was sure that running expensive operations in threads can prevent UI freezing, but now I'm not. Is it not guaranteed that a threaded operation will not hog the main thread's ...
1
vote
0answers
236 views

Expensive operations and threading in XNA games [closed]

There's this post, it's highest voted answer got me curious about the many ways of threading games. My game has input update, game logic update, user interface update and expensive operations ...
53
votes
5answers
10k views

How does Dwarf Fortress keep track of so many entities without losing performance?

In Dwarf Fortress you can have hundreds of Dwarves, animals, goblins, etc in game at any one time, each with their own complex AI and pathfinding routines. My question is how does this not produce ...
4
votes
4answers
993 views

Creating the concept of Time

So I've reached the point in my exploration of gaming where I'd like to impliment the concept of time into my little demo I've been building. What are some common methodologies for creating the ...
1
vote
3answers
226 views

Multithreading for a mixed-genre game in Python?

So here's the situation. I'm making a game that mixes two genres; arcade shooter and puzzler. They don't intertwine TOO much; all the interaction that really goes on is that every time an enemy is ...
2
votes
1answer
959 views

Code structure in Android 2D game

Well I've finnaly decided to start Android game dev, and my first project will be simple 2d canvas based game. I have some experience in game developing with C# and XNA, and I'm a bit confused now. ...
4
votes
1answer
649 views

How do I use threads together with DirectX11?

I have only found the documents on MSDN: http://msdn.microsoft.com/en-us/library/windows/desktop/ff476884(v=vs.85).aspx Although it doesn't say anything about creating them, it mentions that device is ...
4
votes
1answer
405 views

Splitting logic into threads in Java tower defence game

I'm making a tower defence game in Java! It's my first game development. I want to know how many threads Do I need to create in a game, to split logic.. I've made this one: Main App thread (adds ...
0
votes
1answer
105 views

Efficiency concerning thread granularity

Lately, I've been thinking of ways to use multithreading to improve the speed of different parts of a game engine. What confuses me is the appropriate granularity of threads, especially when dealing ...
5
votes
1answer
204 views

Should I amortize scripting cost via bytecode analysis or multithreading?

I'm working on a game sort of thing where users can write arbitrary code for individual agents, and I'm trying to decide the best way to divide up computation time. The simplest option would be to ...
0
votes
3answers
215 views

Threads slowing down application and not working properly

I'm making a software renderer which does per-polygon rasterization using a floating point digital differential analyzer algorithm. My idea was to create two threads for rasterization and have them ...
0
votes
1answer
426 views

Separate update and render

I'm programming a simple Snake in Java. I'm a complete newbie when it comes to Java and Game Developing, so please bear with me ;) Until now, I have been using a UI thread, as well as a ...
4
votes
2answers
1k views

How to create a thread in XNA for pathfinding?

I am trying to create a separate thread for my enemy's A* pathfinder which will give me a list of points to get to the player. I have placed the thread in the update method of my enemy. However this ...
5
votes
1answer
311 views

Does using [STAThread] with XNA have any negative implications?

I'm working on a game in XNA, which has an inbuilt level editor. To facilitate this I want use the FileOpenDialog from Winforms. I followed the instructions as per this answer. This involves setting ...
2
votes
1answer
190 views

Does concurrency inherently introduce “randomness” into a game?

When a game is implemented with concurrency (as most games are), does this necessarily, by its very nature, introduce an element of randomness into the game that is outside of the players' control? ...
3
votes
4answers
1k views

How to properly multi thread an RPG

I am working on an RPG type game in Java and I would like to know a few things relating to threading, What is the best way to implement a "wait for this then do this" without hanging the whole ...
2
votes
4answers
787 views

Do games use threads?

I 'understand' that the concept of how a game runs i.e while (game_loop = true) { //handle events // input/output/sound etc } But it has come to my attention while programming in another ...
1
vote
5answers
1k views

multi-thread in mmorpg server

For MMORPG, there is a tick function to update every object's state in a map. The function was triggered by a timer in fixed interval. So each map's update can be dispatch to different thread. At ...
7
votes
2answers
2k views

Multi threaded game - updating, rendering, and how to split them

From the StackOverflow post (it was recommended I move this): So, I'm working on a game engine, and I've made pretty good progress. However, my engine is single-threaded, and the advantages of ...
2
votes
4answers
2k views

How to separate my rendering from game loop?

If I have a (complex) operation that takes a long time for it to finish, for instance, a couple of seconds, my frame rate drops far below the acceptable. How could I still implement it while it is not ...
3
votes
2answers
501 views

Is it safe to run multiple XNA ContentManager instances on multiple threads?

My XNA project currently uses one ContentManager instance, and one dedicated background thread for loading all content. I wonder, would it be safe to have multiple ContentManager instances, each in ...
1
vote
2answers
580 views

Multi-threaded JOGL Problem

I'm writing a simple OpenGL application in Java that implements the Monte Carlo method for estimating the value of PI. The method is pretty easy. Simply, you draw a circle inside a unit square and ...
2
votes
3answers
303 views

Multithreaded game fails on SwapBuffers in render thread at exit

The render loop and windows message loop run on separate threads. The way the program exits is that after PostQuitMessage is called in WM_DESTROY the message loop thread signals the render loop thread ...
1
vote
2answers
118 views

Threading iPhone

Say I have a group of large meshes that I have to intersect rays against. Assume also, for whatever reason, I cannot further simplify/reduce poly check count by spatial subdivisioning. I can do this ...
0
votes
0answers
54 views

XNA Xbox, utilizing multiple cores [duplicate]

Possible Duplicate: XNA: How does threading work? It's my understanding that the Xbox has 3 cores that are available to use. I'm hoping to offload AI to another core, and possibly use ...
1
vote
1answer
168 views

Thread.SetProcessorAffinity() equivalent for Windows?

I want to be able to use multiple cores in my XNA game, but it seems that Thread.SetProcessorAffinity() is only usable on xbox. That being said, is there any way to run a small chunk of my code on ...
2
votes
5answers
2k views

Xna Loading Screens

I'm making a 2D XNA game. I'd like to implement loading screens when stuff has to load for a while. Like when I login to an account, connect to the server, and generate worlds. I'm pretty sure it ...
2
votes
3answers
511 views

Should I dedicate a single thread to each player in a split-screen game?

I was thinking about making multiplayer version of a game I am making with SDL and OpenGL. It would be a split-screen game. Do you think it would be a good idea to have each part of the screen (game ...
2
votes
1answer
287 views

Parallelizing creation of geometry chunks in minecraft-like game

In my game I separate creation of chunks into two stages. The first is where I generate the heightmap using simplex noise and the 2nd is when I create the actual vertex buffers. I do it like this so ...
0
votes
1answer
165 views

Saving big maps

When the map is relatively small, it takes a few milliseconds to save it, so it's generally ok. But with other, much much bigger maps, it could take several seconds, which is both annoying and hangs ...
1
vote
1answer
416 views

Updating scene graph in multithreaded game

In a game with a render thread and a game logic thread the game logic thread needs to update the scene graph used by the render thread. I've read about ideas such as a queue of updates. Can someone ...
2
votes
2answers
407 views

Is using a dedicated thread just for sending gpu commands a good idea?

The most basic game loop is like this : while(1) { update(); draw(); swapbuffers(); } This is very simple but have a problem : some drawing commands can be blocking and cpu will wait ...
0
votes
2answers
473 views

Game thread, render thread, animation/inverse kinematics, and synchronization

In a multithreaded setup with a game logic thread and a render thread, with some kind of skin mesh animation with inverse kinematics plus etc how does animation work? Does the game logic thread just ...
-3
votes
2answers
199 views

Libraries for multi threading

When multithreading a game what do i need to think about when picking the Libraries when developing for pc? I have been looking at process.h and was wondering if there are any big downsides (like ...
-1
votes
1answer
640 views

Thread safe double buffering

I am trying to implement a draw map method that will draw the tiled image across the surface of the component. I'm having issue with this code. The double buffering does not seem to be working, ...
4
votes
4answers
1k views

A* algorithm very slow

I have an programming a RTS game (I use XNA with C#). The pathfinding is working fine, except that when it has a lot of node to search in, there is a lag period of one or two seconds, it happens ...