[Mongrel] Rubygems and Fastthread problem

Luis Lavena luislavena at gmail.com
Tue Dec 26 17:43:57 EST 2006

On 12/26/06, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> Heya Folks-
>         This is mainly for Zed and Mentalguy. I have been playing with the
> new release of rubygems and I have a major problem with the
> requirement that fastthread needs to be required before thread. Just
> requiring rubygems and then requiring fastthread right after that
> will throw the error:

Oh boy, I guess that deserve a post at rubygems mailing list
(rubygems-developers at rubyforge.org)

> ez _blog $ ruby
> require 'rubygems'
> require 'fastthread'
> __END__
> /usr//lib/ruby/gems/1.8/gems/fastthread-
> fastthread.bundle: fastthread must be required before thread
> (RuntimeError)
>          from /usr//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> 32:in `require'
>          from -:2
> ez _blog $ ruby -v
> ruby 1.8.5 (2006-08-25) [i686-darwin8.7.1]
> ez _blog $ gem -v

FastThread "patches" thread library, its required that some things get
defined by fastthread prior thread do his thing... (that was mental
comment on this issue).

I guess rubygems folks added thread part of rubygems now... something
that isn't good at all (why I require thread if my application I don't
use it?, just to say something).

>         I have been requiring fastthread in Merb but now that mongrel uses
> it I want to remove my requires for it from merb. But right now with
> the new version of rubygems I can't use fastthread installed as a gem
> at all.

I've been using RUBYOPT=rubygems so guess will suffer from the same illness.

>         Is the solution to this just to install fastthread via setup.rb
> instead of gems so we can require it first? Does fastthread really
> have to be required first? Can this be changed?

The setup.rb way is one possibility, the other is ask the rubygems
teams to check their code.

>         Another area where I run into this issue is with rake. rake requires
> thread when you invoke it form the command line before you get a
> chance to require fastthread first. So you get the fastthread load
> error.

Er... you're using fastthread in rake? Could I ask what for? I suppose
rake isn't for long running tasks...

The other workaround will be hack lib/ruby/1.8/thread.rb and require
fastthread there.

>         Whats the best solution to this? Can fastthread be made to be ok if
> it loads after thread? Fastthread is great and has really improved
> the mem profile for me in a bunch of installs. But with this new
> version of rubygems there doesn't seem to be a way to use fastthread
> at all if it is installed as a gem.
>         Here is the same test run with the current 0.9 version of rubygems:
> ey00-s00089 ~ # ruby
> require 'rubygems'
> require 'fastthread'
> __END__
> ey00-s00089 ~ # ruby -v
> ruby 1.8.5 (2006-08-25) [x86_64-linux]
> ey00-s00089 ~ # gem -v
> 0.9.0
>         It works fine here. But I suspect this will start affecting more and
> more folks as they upgrade to rubygems latest.
> Thoughts?
> Cheer-s
> -- Ezra Zygmuntowicz
> -- Lead Rails Evangelist
> -- ez at engineyard.com
> -- Engine Yard, Serious Rails Hosting
> -- (866) 518-YARD (9273)
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users

Luis Lavena
Multimedia systems
Leaders are made, they are not born. They are made by hard effort,
which is the price which all of us must pay to achieve any goal that
is worthwhile.
Vince Lombardi

More information about the Mongrel-users mailing list