Author Topic: multi-thread unsafe operations  (Read 4340 times)

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
multi-thread unsafe operations
« on: March 27, 2013, 01:45:26 pm »
Egon can you please briefly document what operations are or aren't safe for multi threading? for example rendering, displaying buffer and modifying an object/mesh which is in the rendered world obviously are not.

I'm pretty convinced that I'm sometimes having a multi-threading issue because of level loading at background. I basicly create a new world, load game objects from serialized data, attach vertex controllers and create particles. all of these are new instances. shadows are initialized later on in GL thread. no texture loading here either.

but I guess, one of these operations (or another one which I missed) is causing a multi-threading issue.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: multi-thread unsafe operations
« Reply #1 on: March 27, 2013, 08:35:14 pm »
Doesn't sound like something that is supposed to raise any problems to me. What kind of issue do you have with this? Does it go away if you don't do the loading in another thread?

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: multi-thread unsafe operations
« Reply #2 on: March 28, 2013, 01:20:03 am »
it's the one I've mentioned in this post. you said it was looking like a threading issue. however you cant see it since I had deleted the video from my server. I will record another tomorrow..

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: multi-thread unsafe operations
« Reply #3 on: March 28, 2013, 11:17:48 am »
I've uploaded the same capture again:
http://aptalkarga.com/tmp/weird-1.avi

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: multi-thread unsafe operations
« Reply #4 on: March 28, 2013, 11:35:56 am »
there are some quads which are loaded in another thread and share mesh and compiled data with a master copy, can it be causing the problem?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: multi-thread unsafe operations
« Reply #5 on: March 28, 2013, 04:55:07 pm »
I'm not sure...in that video, it's constantly loading stuff in the background? What happens, if you don't load any data in the background?

Offline raft

  • quad
  • ******
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Re: multi-thread unsafe operations
« Reply #6 on: March 28, 2013, 05:18:37 pm »
no, game loading and game rendering is not done in parallel. what is in the video is render stage only. when loading starts previous game is discarded and a loading text is blitted. just like in the android version.

I'll try loading game in GL thread and post results

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: multi-thread unsafe operations
« Reply #7 on: March 29, 2013, 05:40:05 pm »
I doubt that this has anything to do with loading stuff in a background thread. It looks more some multi threaded operations at runtime. But if that doesn't happen, i've no idea what should cause it nor have i ever seen something like that. If nothing else helps, i need the application to have a look at it myself.