swarm-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [swarm-hackers] Help on Heatbugs (Git)


From: Nima Talebi
Subject: Re: [swarm-hackers] Help on Heatbugs (Git)
Date: Thu, 19 Nov 2009 15:27:55 +1100

Hi Scott, I've placed an "assert(1==0)" inside the threaded block to make sure it never gets hit - and it doesn't, so it's strange that removing it made things better for you.

Here is the result of Instruments(ObjectAlloc) though; Again it seems to be deep in Swarm... how did you figure out it was the HeatCells (I'll look into this right now)?

I'll let you know how I go...

Nima




On Thu, Nov 19, 2009 at 12:54 PM, Scott Christley <address@hidden> wrote:

On Nov 18, 2009, at 4:50 PM, Nima Talebi wrote:

Issue Part I

Hmmm, no I haven't removed any such code, mainly because it doesn't exist in the Heatbugs app (and I haven't modified the framework)...

Okay, then probably the best thing to do is run one of the performance tools, I think its ObjectAlloc.  That will give you an idea of what objects are being allocated and growing.



Issue Part II

Regarding threads - What I found is that drawing the heatspace is quite time consuming, so I wanted to processing to just continue on one processor, while the other one, in the background (and on another core), updates the slow-to-compute heatspace display.

The better way to do this is don't update the GUI display so often, so in HeatbugsGUI change the display frequency from 1 (which means to update the GUI every single time step) to some larger number like 10.


obj->displayFrequency = 1;


But you may have missed my main point from the earlier email, you cannot let the simulation continue, while at the same time trying to "probe or query" the simulation (from another thread) to update a display, because the simulation may change its state in the middle of the "query".  In the minimal case, your display is just updated with wrong simulation state info.  In the worst case, your display attempts to access simulation objects that no longer exist, thus causing an exception.


But as you said a few days ago, if it's not dangerous to call [self swarmHasUpdatedNotification] unless exactly one run of a `[heatSpaceDisplay updateDisplay]' AND one run of a following `[heatbugDisplay updateDisplay]' is already executed, then I can't really thread.

I'm not sure I understand your paraphrase, why the emphasis on AND?  dangerous to call?

If the comments in the -updateGraphicalDisplays method don't make any sense, then maybe they need more elaboration so that they do make sense.  They make perfect sense to me, but then I wrote them ;-)

Scott


_______________________________________________
swarm-hackers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/swarm-hackers




--
Nima Talebi
web: http://ai.autonomy.net.au/People/Nima
gpg: B51D 1F18 D8E2 B702 B027 23A4 E06B DAC1 BE70 ADC0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]