Re: I think I don't quite understand threading...
From: Abs (abs_at_terra.es)
Date: 05/08/04
- Next message: Ken Ream: "Re: Passing Objects as Parameters"
- Previous message: Web Surfer: "Re: Tomcat Admin password forgotten"
- In reply to: xarax: "Re: I think I don't quite understand threading..."
- Next in thread: xarax: "Re: I think I don't quite understand threading..."
- Reply: xarax: "Re: I think I don't quite understand threading..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
- Next message: Ken Ream: "Re: Passing Objects as Parameters"
- Previous message: Web Surfer: "Re: Tomcat Admin password forgotten"
- In reply to: xarax: "Re: I think I don't quite understand threading..."
- Next in thread: xarax: "Re: I think I don't quite understand threading..."
- Reply: xarax: "Re: I think I don't quite understand threading..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|