Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

wave file to frame (RUBY)

Post any examples or modules that you want to share here

Re: wave file to frame (RUBY)

Postby Tronic » Sat Jun 13, 2015 8:42 pm

Be careful because the ruby thread are not executed if at least one RubyEdit is not re-triggered continuously.
For example, in your schematic it works because you have a Mono-Readout doing this,
otherwise it will freeze and is never executed until arriving at any RubyEdit certain triggers.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: wave file to frame (RUBY)

Postby KG_is_back » Sat Jun 13, 2015 9:12 pm

Confirmed... making the "progress" readout trigger faster makes the loading faster... How to make it run continuously?
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: wave file to frame (RUBY)

Postby Tronic » Sat Jun 13, 2015 9:54 pm

How to make it run continuously?

you can't, but i use this
Code: Select all
def event i,v,t
   if (i==0)
      @thread= Thread.new do         
         # do some process
         @thread.exit
      end               
   end
   # here retrig until the thread finish
   input 100, nil,t+0.001 if @thread.alive?
end


and sincerely this is an odd function of how the ruby is implemented in FlowStone
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: wave file to frame (RUBY)

Postby KG_is_back » Sat Jun 13, 2015 11:19 pm

I've found out, that putting the main thread to "sleep" boosts the loading speed significantly. It seems that during the sleep, the ruby interpreter stays active and has free time to process secondary threads, like the loading one.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: wave file to frame (RUBY)

Postby tulamide » Sun Jun 14, 2015 12:22 am

Tronic wrote:and sincerely this is an odd function of how the ruby is implemented in FlowStone

Indeed! It renders the purpose of multiple threads almost useless.

KG_is_back wrote:I've found out, that putting the main thread to "sleep" boosts the loading speed significantly. It seems that during the sleep, the ruby interpreter stays active and has free time to process secondary threads, like the loading one.

That's what I said in a prior post. It is slow, because it is a sub-thread. While it is certainly interesting to see, that you can boost it by setting the main thread to sleep, the question is what will be the advantage? Pretty much nothing. One could as well call a method in the main thread with a time delay. That would also give processor time for graphic updates, etc., while loading is fast.
It disappoints me that multi-threading can't be used effectively.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: wave file to frame (RUBY)

Postby Tronic » Sun Jun 14, 2015 1:27 am

After several tests with the class thread,
the thread actually runs in the background, but to have a return feedback from it,
of course we must now retigger the RubyEdit module,
but I believe we can transfer the return via a send function or some sort of callback to caller thread,
we investigate this.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: wave file to frame (RUBY)

Postby Tronic » Sun Jun 14, 2015 2:27 am

hehe, I have to contradict yet, it only works if retriggered, otherwise it stays still,
sorry I missed a readout active.
here I stop I'm tired.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: wave file to frame (RUBY)

Postby KG_is_back » Sun Jun 14, 2015 10:42 pm

I've written an E-mail to the DSPR support. Perhaps they can give us some insight on why this is happening and possibly even solve the problem.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Previous

Return to User Examples

Who is online

Users browsing this forum: No registered users and 37 guests