Re: I think I don't quite understand threading...

From: Abs (abs_at_terra.es)
Date: 05/08/04


Date: Sat, 08 May 2004 16:03:48 +0200

xarax wrote:

> "OscarC" <oscarc@fib.upc.es> wrote in message
> news:2g3h7lF42q9bU1@uni-berlin.de...
>
>>Hi!
>>
>> I'm building a slideshow app and I'd like to be able
>>to play some music while viewing the photos. So, I thought
>>in using two separate threads, one for the slideshow and
>>another for playing the music (I'm using javazoom.net's
>>MP3 libraries). Something like this:
>>
>>Thread t1 = new Thread(new Slideshow(album));
>>t1.start();
>>
>>Thread t2 = new Thread(new MP3Play());
>>t2.start();
>>
>>The t1 thread opens a new undecorated JFrame and shows
>>the photos one after another. The t2 threads starts
>>playing some MP3 file.
>>
>>Using this I'm not getting what I want. Now, the music
>>plays AFTER viewing the photos, not at the same time
>>which is the purpose of using threads. What am I doing
>>wrong ?
>
> /snip/
>
> There is apparently some synchronization issues
> between the two threads, causing the second thread
> to block until the first thread has completed its
> work.
>
> What is the behavior when you change the order
> of starting the threads? Will the music play
> and the pictures wait until the music is finished?
>
>

Yes, I've tried to reverse the starting order of
the threads with the same result, the music starts
after the slideshow.



Relevant Pages

  • I think I dont quite understand threading...
    ... to play some music while viewing the photos. ... public void stateUpdated{ ...
    (comp.lang.java.programmer)
  • Re: I think I dont quite understand threading...
    ... > I'm building a slideshow app and I'd like to be able ... > to play some music while viewing the photos. ...
    (comp.lang.java.programmer)
  • Video CD?
    ... Sonic Record ... i want to play a slideshow of photos with background music ...
    (microsoft.public.windowsxp.help_and_support)
  • Video CD?
    ... Sonic Record ... i want to play a slideshow of photos with background music ...
    (microsoft.public.windowsxp.general)
  • a Video CD
    ... Sonic Record ... i want to play a slideshow of photos with background music ...
    (uk.rec.video.digital)