Old 11th September 2011, 19:57   #1
markuspeloquin
Junior Member
 
Join Date: Apr 2011
Posts: 5
Multithreaded transcoding

Due to some stupid Winamp bugs, I have to re-transcode and transfer my entire library to my ipod. The estimate on time remaining is 6.5 hours because it's using the simple approach of one track at a time. I would love it if you could use all my CPUs. I'll even give you the algorithm (in Perlish pseudocode)!

@no_transcode = grep { !need_transcode($_) } @tracks_to_transfer;
@transcode = grep { need_transcode($_) } @tracks_to_transfer;
transfer($_) for @no_transcode;
# Start NCPUS threads that all repeatedly pull a track off the shared queue and send it to transfer()
async_workers(NCPUS, shared_queue(@transcode), transfer);

That's how I'd do it with threads anyway.

edit one more note: course-grained parallelism is SO EASY please do it
markuspeloquin is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Winamp > Winamp Wishlist

Tags
concurrency, ipod, multithreading, transcode

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump