You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to cause images to be drawn in the midst of computations? (To show the evolving images as computations progress.) Where's a Matlab-style drawnow? The only way I've found to do this is inserting a sleep after imshow (or the sam after a push! into a Signal—not very “reactive” those signals). The sleep of course slows down computations and does not do anything in a Distributed thread (that would run on another CPU core and thus not significantly affect the computations) to have the drawing process in the background. It seems that the only way to force a redraw is to make Julia completely idle.
The text was updated successfully, but these errors were encountered:
After some further hunting through the sources of ImageView/Gtk/GtkReactive, my hunch is that something is preventing notify_realize within Gtk/cairo.jl from being called. It turns out that one only needs to sleep once in the beginning after the widgets and canvases have been created. It is not necessary to sleep after each animation frame, they are redrawn just fine, as long as that initial sleep is performed. My guess is that this somehow allows things to switch over to Gtk… but to a Thread or a Task, I don't know, things seem very weird how Gtk has its own main loop that should not in anyway to my knowledge be compatible with Julia's Tasks, at most Threads. Indeed a simple yield is not sufficient, only a sleep works. But the main difference between those is that sleep will call system pause if there are no Julia internal Tasks to run.
Based on comments in the source of GtkReactive/graphics_interaction.jl, maybe relevant: JuliaGraphics/Gtk.jl#368 and #153
How to cause images to be drawn in the midst of computations? (To show the evolving images as computations progress.) Where's a Matlab-style
drawnow
? The only way I've found to do this is inserting asleep
after imshow (or the sam after apush!
into a Signal—not very “reactive” those signals). Thesleep
of course slows down computations and does not do anything in aDistributed
thread (that would run on another CPU core and thus not significantly affect the computations) to have the drawing process in the background. It seems that the only way to force a redraw is to make Julia completely idle.The text was updated successfully, but these errors were encountered: