Sunday, May 31, 2009

Free Surf 71

Again threading problems.

Hello.

I am now coding a small application that should do the following:

1. User inputs timestamps in a file.
2. Application starts a thread and check every second if the current
time is equal to any timestamp in the file (stored in a struct however).
3. If its time, the thread call a function, a http post using mechanize.
4. Application should be runable both on linux and windows.

However, i have gotten some big problems, first, there were a bug with
threads in ruby 1.8.6 and standard I/O (gets) + windows, however I got
help here on the ruby forum to fix that with an alternative input
method.

What the problem is now that the function i am calling in the thread
doesn't run anyway(some problem with mechanize and threads aswell?)
since the function runs fine when i for example place it in initialize
for the class. And I can comment out the function and for example just
change a variable in it and it works fine aswell.

So I heard that in 1.9.1 there should be no bugs like this, however I
haven't yet found a way to fully install ruby 1.9.1(on windows) with
mechanize (+ needs nokogiri), when trying to install them I always gets
some kind of errors for missing .so files etc.

Anyone managed to install 1.9.1 + mechanize(+nokogiri)?
Anyone had the same problem as me?
What do people normally do when coding things like this?, I mean, the
things that the application do shouldn't be that unusual.

Best regards

No comments:

Post a Comment