Feb
24
comment Why does Parallel.For execute the WinForms message pump, and how to prevent it?
Some more research on this after evaluating the answers so far: github.com/AdamsLair/duality/issues/295
Feb
23
comment Why does Parallel.For execute the WinForms message pump, and how to prevent it?
Thanks! Will give this a try :)
Feb
21
comment Why does Parallel.For execute the WinForms message pump, and how to prevent it?
Of course I could write a wrapper class for Parallel that has internal knowledge about this, which it shares with the editor, should it be present, but if there was a way to avoid that, I'd very much prefer it.
Feb
21
comment Why does Parallel.For execute the WinForms message pump, and how to prevent it?
The game engine code that uses Parallel.For is part of a core library that may or may not be executed in an editor or WinForms environment, so there is no knowledge about the concepts required to solve this problem. It get's worse when considering that the engine is plugin-based, so there's platform- and environment-agnostic user code that could use Parallel.For. Since the root of the problem is part of the WinForms context, it would be preferable if the solution could be part of the same context, rather than being that "invasive" to core and user code.
Feb
21
comment Why does Parallel.For execute the WinForms message pump, and how to prevent it?
Unfortunately, I don't really know when I'm not ready, as there is no clear update-render cycle in an editor context. If the user interacts with an arbitrary editor UI element, it could, theoretically, invoke core engine code in order to update game data as requested by the user. This update may or may not use Parallel.For, which then triggers a paint event in the middle of a data update. How would I know when to reject this event if I don't know how it was triggered? There is no "invalidation loop" for the engine core that represents the only valid time to redraw the game view.
Feb
21
comment Why does Parallel.For execute the WinForms message pump, and how to prevent it?
Thanks for your explanation! The behavior may very well be caused by user interaction, as it usually happens in editor mode, where an embedded game view allows to edit and interact with the scene. The game loop isn't running in this case, but redrawing and updating is done on-demand - which can trigger arbitrary core game code that unfortunately expects to remain in full control until it finished. The bool solution probably won't cut it in this case. Anyway - I'll investigate some more on possible alternatives :)
Feb
21
comment Why does Parallel.For execute the WinForms message pump, and how to prevent it?
Parallel.For is called as part of the game engine code, which is in a distinct library that may or may not be invoked by a WinForms application. Consequently, there is no concept of "blocking the UI" or not, so this is unfortunately not an option. It's also not really a concern, as a hard requirement of the game engine is to finish all update calculations of a frame within around 16 ms to remain interactive at all times.
Feb
21
asked Why does Parallel.For execute the WinForms message pump, and how to prevent it?
Feb
20
awarded Critic
Feb
19
awarded Yearling
Feb
19
awarded Yearling
Dec
2
awarded Announcer
Jul
6
accepted Why isn't it faster to update a struct array than a class array?
Jul
5
comment Why isn't it faster to update a struct array than a class array?
@HenkHolterman Both my assumption and my measurements could be wrong. I made an assumption, I tried to verify it, I failed. Now I want to find out, why exactly that is. That's why I asked. To me, your comment of "don't guess, measure" doesn't seem to make sense when issued to someone who just performed a measurement and is genuinely trying to discuss it. "Your assumption was wrong" is a valid answer and certainly among the ones I was looking for - I was just thrown off a little by the comment after that.
Jul
5
comment Why isn't it faster to update a struct array than a class array?
@HenkHolterman I'm asking for help in interpreting my performance measurement results - not quite sure what to make of your statement?
Jul
5
revised Why isn't it faster to update a struct array than a class array?
deleted 6 characters in body
Jul
5
asked Why isn't it faster to update a struct array than a class array?
Jul
3
comment Performance drop after upgrading to .NET 4.5
What does your application do?
Jun
10
awarded Commentator
Jun
10
comment GetTypeInfo Performance in Windows Store Apps
Not sure what being a static reflection method has to do with creating or not creating new objects - depends on how they're implemented, doesn't it? Which is kind of what I'm asking. I already looked through mscorlib, but it was of course the .Net 4.5 one. Not the one I'm interested in - where did you find the Windows Store App implementation?
1 2 3 4 5