smalltalk
July 29, 2010 8:22:25.663
Ramon Leon talks about his implementation of a thread pool for Smalltalk (in the context of a Seaside app):
I had a search result page in Seaside that launched about 10 background threads for every page render and then the page would poll for the results of those computations, collect up any results found, and AJAX them into the page. Each one needs to run in its own thread because any one of them may hang up and take upwards of 30 seconds to finish its work even though the average time would be under a second. I don't want all the results being stalled waiting for the one slow result, so it made sense to have each on its own thread. This worked for quite a while with nothing but simple forking, but eventually, the load rose to the point that I needed a thread pool so I could limit the number of threads actually doing the work to a reasonable amount. So, let's write a thread pool.
It's easy to think that threads in Smalltalk are "free" - they are green threads, so what the heck - let's use more! However, you will (as Ramon writes) eventually hit a wall. I ran into one in BottomFeeder years ago, for slightly different reasons.
In BottomFeeder, I fork a Smalltalk process for each http request during an update loop. I subscribe to over 200 feeds, so that can amount to a lot of threads simultaneously clamoring for bandwidth. On my (fast) home connection, this was never a problem. However, back in the early 2000's, I was still running into dialup on the road at times, and even now, I periodically run into very slow Wifi. On slow connections, forking off that many processes just hurts more than it helps - so I wrote a thread pool into Bf.
What I should have done is what Ramon did - write a more general solution instead of burying it inside an app. However, it does show that this is something you might need, especially in the modern world of frequently (or always) connected apps.
Technorati Tags:
threads, green thread
posted by James Robertson
smalltalk
July 29, 2010 7:46:43.607
Smalltalkers have more choices than ever in terms of platform (dialect) and framework - AidaWeb now runs on Pharo (it already supported Cincom Smalltalk and Squeak). From Janko in the Pharo mailing list:
I just made Aida ready on new and wonderful Pharo 1.1. and now Aida installs and run nicelly and even side by side with Seaside. You can even run both on the same Swazoo web server, which is also included.
Choice is good - you can now run a Smalltalk server built on a commercial grade web framework (AidaWeb or Seaside), using a standard database solution - Glorp - and have that server move pretty seamlessly between the various Smalltalk dialects.
Technorati Tags:
pharo, aidaweb, seaside
posted by James Robertson
smalltalk
July 27, 2010 11:40:36.295
I decided to take a serious look at OAuth again - since I have a Twitter account and a set of application keys, I'm using Twitter as the service to test against. I had problems the last time I tried this; I spent awhile reading various websites, and this Twitter developer page has a nice sample of what you should be creating. The problem I was having?
- The callback url needs to be double encoded, something I missed the first time around
- In creating the signature base, I had managed to drop an ampersand from a spot where it needed to be
So now I'm writing some actual code, instead of just ramming my head against a wall in a workspace. With luck, I should have something working (and posted to the public store) later today or tomorrow.
Technorati Tags:
web, authentication
posted by James Robertson
smalltalk
July 26, 2010 20:55:54.975
Looks like the Pharo sprint at Camp Smalltalk London paid off:
Pharo 1.1 was released on July 26, 2010. This is the second release. It provides bug fixes, system cleanup, and new features. In total, 883 issues were resolved and went into this version.
Technorati Tags:
pharo
posted by James Robertson
smalltalk
July 25, 2010 10:36:08.756
We have a pretty interesting lineup over the next three weeks:
- Eliot Miranda on his Cog VM (Part 1)
- Eliot Miranda on his Cog VM (Part 2)
- Alejandro Reimondo and Frank Lesser on their Smalltalk VM
The last one above is a bit short, I recorded it at Camp Smalltalk London a week ago - but I figure it's of interest to Smalltalkers. Good stuff coming down the pike!
Technorati Tags:
podcast, industry misinterpretations
posted by James Robertson
smalltalk
July 24, 2010 9:00:19.385
The 4th annual Smalltalks conference in Argentina has issued a call for submissions:
SMALLTALKS 2010
4th Argentinian Smalltalk Conference
Research Track: Call for Papers
November 11th – 13th, 2010
Important dates:
Submission (Hard Deadline): September 7th, 2010 (Argentinian time: UTC/GMT -3 hours).
Notification of acceptance: October 6th, 2010.
Camera Ready Submission: October 20th, 2010.
The Smalltalks conferences have been growing pretty nicely, so it looks like a great opportunity to get in front of Smalltalkers you probably haven't seen yet.
Technorati Tags:
argentina
posted by James Robertson
smalltalk
July 23, 2010 18:44:47.018
I spent the afternoon taking a look at the performance of VW, Pharo on Cog, and Squeak on a standard VM. I used the package SimpleBenchmarks from the public store repository - I have a Squeak port as well. Here are the numbers (in milliseconds) for the tests, each one running 100,000 times on my Macbook Pro:

You'll have to grab the code to see exactly what the tests do, although the names are mostly explanatory. Bottom line: VisualWorks is still pretty darn fast, but if you're using Squeak or Pharo, Cog looks like a good thing.
Technorati Tags:
benchmarks, performance
posted by James Robertson
smalltalk
July 23, 2010 13:25:55.864
I had another look at the Twitter documentation pages for the OAuth workflow; it seems a bit more detailed than it was when I last looked. With 7.7.1 done (not released, but in the process of being released), it's time I had another look. So - on with the OAuth attempts.
Technorati Tags:
oauth, twitter
posted by James Robertson
smalltalk
July 23, 2010 10:23:30.215
Chris Thorgrimsson has announced the Cairo Graphics Kit over on his VW/Cairo blog. It's a set of new view objects for VW done up in Cairo - to get going with it, make sure you load Cairo (the parcel that comes with VW) and the UIPainter first. If you see load time exceptions, it most likely means that you forgot to load the UI Painter.
Technorati Tags:
graphics, cairo, pango
posted by James Robertson
smalltalk
July 21, 2010 7:52:15.792
posted by James Robertson