New topic: 

Thread speed issue...

<http://forums.realsoftware.com/viewtopic.php?t=37073>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        jasmatuphcreations          Post subject: Thread speed 
issue...Posted: Thu Jan 13, 2011 7:03 pm                         
Joined: Fri May 07, 2010 9:40 pm
Posts: 23                Hi there,

I'm after some help regarding threads. I can't seem to set the priority for my 
thread to give it more speed.

e.g myThread.Priority = 7

This method or Property does not exist, even though when I type myThread.p (it 
shows Priority in the list of proprties)

My Thread.run code is :

  Dim strURLToVideo As String
  Dim intAdvertisingVideoId as Integer
  Dim strDescription As String
  
  //process data
  intAdvertisingVideoId = 1
  strURLToVideo = 
DLookup("[VideoURL]","tbl_AdvertisingVideos","[AdvertisingVideoId]=" + 
CStr(intAdvertisingVideoId))
  strDescription = 
DLookup("[Description]","tbl_AdvertisingVideos","[AdvertisingVideoId]=" + 
CStr(intAdvertisingVideoId))
  
  wAdvertismentSponser.btnPurchaseURL.caption = strDescription
  wAdvertismentSponser.HTMLViewer1.LoadURL(strURLToVideo)
  
  //show window
  wAdvertismentSponser.Visible = true
  
I current have a piece of code that reads in your files, so if you dump a 
directory it will loop through them analyzing and adding to the db. This takes 
a long time.. sometime 3-4 minutes, in the meantime I would like them to watch 
a promo video in a popup window whilst they wait. However it loads the window 
but until the folder code has finishedyou can't actually play the video.

any help greatly appreciated.

Cheers.   
                             Top                 timhare          Post subject: 
Re: Thread speed issue...Posted: Thu Jan 13, 2011 7:54 pm                       
  
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 8903
Location: Portland, OR  USA                Speed isn't what you need.  You need 
to yield time so the rest of the app (the video) can run.

That said, what is MyThread?  Is it the class name or an instance dropped onto 
a window or the name of a property?  If it is a class name, that would explain 
why you can't assign the Priority.

If there are a lot of files in the directory, RB's FolderItem class is very 
slow.  Using OS level declares to traverse a directory can make a significant 
difference.   
                             Top                jasmatuphcreations          
Post subject: Re: Thread speed issue...Posted: Thu Jan 13, 2011 8:26 pm         
                
Joined: Fri May 07, 2010 9:40 pm
Posts: 23                Do I have create the "Priority" method my self in the 
NEW class I created.

MyThread is my new class of Super = "Thread"

I declare

Dim myThread1 As NEW MyThread

myThread1.Run

So where do I set the Priorty, I thought

myThread1.Priority = 7 

would have worked?

Cheers   
                             Top                 timhare          Post subject: 
Re: Thread speed issue...Posted: Fri Jan 14, 2011 1:13 am                       
  
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 8903
Location: Portland, OR  USA                And so it should.  However, 
myThread.Priority = 7 should not.  One uses an instance; the other uses a 
class.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to