Multi threading in heroku rails3 project?

I am using multi Threading concept to optimize performance of long
array which takes long time to do action with every element. I
used .peach in my code

require ‘peach’
def fr_display
@graph = Koala::Facebook::GraphAPI.new(session[:fbuser]
[“credentials”][“token”])

@friends = @graph.get_connections("me", "friends")
@img=Array.new(@friends.size)
    i=1
   @friends.peach do |friend|

begin
@img[i]=self.get_fb_image(friend[‘id’],friend[‘name’])
rescue StandardError => e
@img[i]="";
end
i=i+1
end

end

but in heroku deployment it is not running and showing error in error
log that New Thread is unable to create.

any solution to work with Multi threading in rails 3 heroku project or
optimize performance without using multi threading.

Thank You in advance

This is what background workers are good for. On heroku your choices are
delayed job and resque (which I prefer) or you might want to use
simpleworker.com, which is a great solution and scales better.

Thank You for your valuable submission. I will follow the document of
simpleworker.com http://simpleworker.com and try.