The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Trust the GC

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
Trust the GC Posted: May 22, 2006 6:51 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Trust the GC
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

Via Don Box, I see that Ian Griffiths has a few issues with continuation based web applications. One issue he brings up is resource usage:

Sometimes the user just walks away. I might get part way through the purchasing sequence on a web site and then decide to stop. The web server never gets any positive indication that I closed the browser window. It merely stops hearing from me.

What does this mean in a world where I’m using continuations to help model user journeys as sequential code? It means that sometimes my functions just stop part way through without reaching the end.

On the plus side, it is predictable where this will happen: it can only occur at boundaries where I choose to construct a continuation and then relinquish control for now. But at every such boundary, I need to be aware that sometimes, the continuation will never execute.

This is very much not analogous to the function returning or throwing an exception. In the world of our chosen abstraction - that of sequential execution of a method - it looks like our thread has hung.

The problem with this is that a lot of the techniques we have learned for resource management stop working. Resource cleanup code may never execute because the function is abandoned mid-flow.

I don't know why this would be a problem, given a halfway decent GC system. The stale session will eventually time out, and take any lingering state down with it. I can see being worried about the memory required by this, in the face of a lot of users, but not in the basic mechanics. In a Smalltalk server - either VisualWorks or Squeak based - Ian's worry is a non-problem. Then he has an issue with thread affinity:

Traditionally, any particular invocation of a function runs on a single thread from start to finish. We’re not accustomed to mid-function thread switches, and it will render some hitherto safe practices unworkable. Using objects with thread affinity will become particularly hazardous, for example - we will need to be mindful of the potential switch points and make sure we never use such objects across such a boundary.

Actually, in this server, I've got requests that end up invoking new processes now, without continuations. They are managed with a class called Promise, but it's pretty simple - it's just a matter of delaying the waiting process and using a signal to inform the waiting process that results are ready. The pre-existing class makes that easy for me, but the code isn't hard to follow either way. Running multiple threads with shared objects is a comlex problem for any kind of application, whether continuations are involved or not.

Then he's got a long riff on how Continuations might break in the face of the Back button. Hmm - that was one of the problems that this approach was designed to solve. So far as I know, this simply isn't a problem in Seaside.

Read: Trust the GC

Topic: carnival of the agilists, 18-may-06 Previous Topic   Next Topic Topic: The Return to Producerism

Sponsored Links



Google
  Web Artima.com   

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