[Seaside] Cooperative Multitasking (within a priority level) and other questions

William E Harford seaside at harford.org
Wed May 18 15:53:04 CEST 2005


First off hello all. 

I am the sole developer at a document management and medical statistics
company. All of our apps are written in PHP and C with a speckeling of
Perl *shiver*. To make a long story short in I have become somewhat
disillusioned by the stateless/Class based OOP. We were laying down
plans to develop our own framework for statefull, prototype based OOP
web development. Then I discovered Seaside. It's almost exactly what I
was looking for. Thanks you all just saved me months of development.
Now .....

I have a few questions about seaside and smalltalk. 

As I understand it Squeak has process (or is it thread) priority levels.
A process with a higher level gets to use the CPU before that of a lower
priority until it is done or yields but but threads in the same priority
level are cooperative. Am I correct so far?

How does this affect seaside ? What if a database query takes 5 minutes
to return will this lock the other seaside processes? What if programmer
does something stupid and creates and endless loop (it happens)?
Or what if there is just some chunk of code that takes a long time to
execute. Will all other Seaside processes wait for it to complete?  

If the above is true this would be unacceptable for what we do but I
don't think it would be to hard to write some sort of preemptor (is that
a word) . You could have a process running at a higher priority level
giving out time slices to processes of a lower priority level; Right ?
Is something like this needed? Should it be done at the webserver level?
I would think it would not be to difficult to add some code to the
webserver to handle this time slicing (when the webserver forks a child
process to handle the request). Am I right ?

Is there any documentation that might explain the above in more detail ?
If the cooperative multitasking is a problem and adding some sort of
preemptive multitasking code is not to hard (it does not seam like it
would be) I would be more than happy to implement it.



Would it be possible to create a "wait" dialog/component. What I mean by
that is a dialog that does not ask for user input but simply refreshes
until a code block completes. Would it be as simple as creating a
component that forks a process, sends a meta/refresh tag (along with
some other "please wait" content), and waits for the process to
complete ?


Our org is very dependent on PDF generation and modification. We
currently use PDFLib (pdflib.com) for most of our PDF needs. The way I
dealt with this in the seaside app I have written is by writing small C
programs that Squeak/Seaside makes calls out to. This is not the ideal
situation. How hard would it be to write a Smalltalk wrapper around the
C (or any other of the bindings) PDFLib lib. I have only found limited
documentation primitives. Am I looking in the right place ? Is there
some documentation that someone could point me to? I was thinking I
could write a parser to parse the C hearer file and create an equivalent
Smalltalk object (PDFLib uses an Object Oriented model) . 


Thanks for you help and thanks for Seaside. 
Will





More information about the Seaside mailing list