The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Inspired by Code Monkey

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Inspired by Code Monkey Posted: Apr 23, 2008 5:58 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Inspired by Code Monkey
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

I was driving to my daughter's school, listening to my iPod, set to shuffle my music, and "Code Monkey" came up. Imagine my surprise when I had a sudden epiphany on a longstanding bug in the blog server.

I had noticed that whenever I pushed a new post up, if I wanted the category specific feed to update, I needed to manually force that to happen. This was irritating, but I hadn't figured out why it was happening - the order (update the cache, then update the feed) looked right. What I hadn't done was delve into the process of cache updating. Here's what that looked like:


	...

	self categoryCache add: category.
	[self cache cacheForCategorySearch: aBlog] 
		forkAt: Processor userBackgroundPriority.

	...

You might see the problem - the cache update code is forked, and at a lower priority than the active thread. Given the Smalltalk Process Model's operation, that thread is guaranteed to not run before the main thread does - which meant that the category specific feed was getting dropped before the cache got updated. I just made sure that the feed gets dropped within that fork, after the cache update - which solves the problem.

So what does it say about me that I came up with this during that song :)

Technorati Tags:

Read: Inspired by Code Monkey

Topic: Seaside in Paper Previous Topic   Next Topic Topic: The Shadow of a Legacy

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use