Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Xander314

Pages: 1 ... 3 4 [5]
61
System / Overhead of sf::Thread::Launch
« on: April 24, 2011, 03:24:07 pm »
Oh, I see! Thanks Mjonir - that has made things clearer.

Quote
if I have a small task to do once in a while (like deleting stuff I don't need, or moving something on the screen), is it really more efficient to launch a thread every X ms that does the job and then disappears than to have a permanent thread that sleeps for X ms after its job is done? Or is it roughly the same?


Do you mean as I did in my original post? Laurent suggested the Launch function may be performance heavy so, while I am not very sure about multithreading yet (hence this forum post...), I am guessing it is worse to keep relaunching the thread. How big are you intending X to be?

62
System / Overhead of sf::Thread::Launch
« on: April 24, 2011, 12:14:05 pm »
I know they don't run at the same speed, but once you have rendered the frame you can't render objects the next frame until you've finished computing physics their new positions.

Nonetheless, you are probably right. It might be best to leave my engine as single core for now. Otherwise I'll probably get the multithreading wrong anyway... :?

Thanks again.

63
System / Overhead of sf::Thread::Launch
« on: April 24, 2011, 09:30:27 am »
Okay, thanks for your help - I really appreciate it. I shall do as you suggested with the thread pool  :)

Quote
why don't you even let each module (graphics, physics, ...) running in its own thread rather than doing it every frame?

I did it this way since it seemed to be the easiest way to synchronise the threads.

OK, so I shall give each of the modules a separate thread at the start. I still need to synchronise them so that they have all completed one frame's computations before going on to the next frame, right? (Please feel free to direct me elsewhere if you feel I'm getting off the subject of SFML...)

64
System / Overhead of sf::Thread::Launch
« on: April 23, 2011, 01:48:25 pm »
I am writing a class to handle 'per frame' multithreading, i.e. graphics, physics, audio etc operations to be run each frame. I then call this every frame:
Code: [Select]
for (unsigned itr=0; itr<ProcessLists.size(); itr++)
    ProcessLists[itr].first->Launch();


where ProcessLists is a map:
Code: [Select]
std::map<sf::Thread*, ProcessList*>
and ProcessList is a class I wrote which defines the list of operations to be carried out on that thread.

My question is: is it inefficient to call sf::Thread::Launch every fram?. Does this function create the actual (Win32) thread etc., or is that done in the constructor? Is there a large overhead associated with sf::Thread::Launch?

Thanks in advance for any help.

65
General / Bulding SFML in VS2010
« on: March 21, 2011, 12:41:32 pm »
Thanks for the tip nexus. I have in fact already done that - when I said I used CMake I meant I had used CMake with SFML 2. I didn't make it very clear though...

66
General / Bulding SFML in VS2010
« on: March 21, 2011, 11:23:53 am »
Ah well I have sorted it now. I just used CMake to generate an actual Visual Studio 2010 project rather than importing the existing VS2008 one. Al the settings were correct then and it worked.

67
General / Bulding SFML in VS2010
« on: March 20, 2011, 11:03:38 am »
I am trying to build SFML 1.6 from the sources, but I am having problems getting Visual C++ 2010 Express to create the import libraries. i saw another thread about this and tried what it suggested: correcting the output directory and adding the names of the import libraries.

However, this still doesn't work. The only way I could get VC++ to build import libraries was by putting the full directory path and filename in the import library property. This doesn't seem like the best way to do it.

Does anyone have any suggestions?

Pages: 1 ... 3 4 [5]
anything