Global session object?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Global session object?

Igor Stasenko
On 9 October 2012 14:28, drush66 <[hidden email]> wrote:

> Igor Stasenko wrote
>> 1. during startup, you have to be very careful about dependencies
>> between services,
>> the errors like using uninitialized service(s) makes image
>> unrecoverable (because VM crashing).
>> For example , putting 'Transcript show: ' before freetype initialized
>> may kill an image,
>> beyond the point of recovery. The hardest part in it, that since
>> everything is late bound, it sometimes really hard to put
>> initialization in right order. And loading any new code in image will
>> also contribute to chaos
>> of interdependencies, unless all developers know that they should not
>> use facility A before facility B is properly initialized. And the only
>> way to do it is to add own checks and one more #startup method,
>> which 'enabling' your service after all dependencies initialized.
>> But the problem is that the longer chain of initialization gets, the
>> more chances that something will go wrong (as well as getting lost in
>> order of dependencies).
>
> Just shooting from the hip, isn't that the same problem that more or less
> all unix os-es have on start up, what parts of systems are alive at
> particular moment and which ones are not. Instead of hard wiring all
> dependencies, maybe introduce different run levels, and roughly divide
> registered start up actions based on the run level?
>
>
run levels just adding another dimension into dependency soup.
they don't solve the dependency problem..
when you say "i run at level 5, so everything which runs at level 4
will be initialized first"
which is equal to saying " Facility A (level 5) should not be used
before facility B (level 4) is
initialized.

>
>
> -----
> http://www.cloud208.com/
> --
> View this message in context: http://forum.world.st/Global-session-object-tp4650371p4650576.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Global session object?

drush66
Igor Stasenko wrote
On 9 October 2012 14:28, drush66 <[hidden email]> wrote:
> Igor Stasenko wrote
run levels just adding another dimension into dependency soup.
they don't solve the dependency problem..
when you say "i run at level 5, so everything which runs at level 4
will be initialized first"
which is equal to saying " Facility A (level 5) should not be used
before facility B (level 4) is
initialized.
They do not solve them, but they make i ta bit les fragile, since you do not specify all facilities that have to run before your own, but you say, any facility from some class (run level), should run before mine. So one can write such rule without knowing explicit list of all facilities that need to run before mine.

But anyway, I have just posted this as an food for thoughts, if it helps or not you decide.
Reply | Threaded
Open this post in threaded view
|

Re: Global session object?

Igor Stasenko
On 9 October 2012 14:45, drush66 <[hidden email]> wrote:

> Igor Stasenko wrote
>> On 9 October 2012 14:28, drush66 &lt;
>
>> davorin.rusevljan@
>
>> &gt; wrote:
>>> Igor Stasenko wrote
>> run levels just adding another dimension into dependency soup.
>> they don't solve the dependency problem..
>> when you say "i run at level 5, so everything which runs at level 4
>> will be initialized first"
>> which is equal to saying " Facility A (level 5) should not be used
>> before facility B (level 4) is
>> initialized.
>
> They do not solve them, but they make i ta bit les fragile, since you do not
> specify all facilities that have to run before your own, but you say, any
> facility from some class (run level), should run before mine. So one can
> write such rule without knowing explicit list of all facilities that need to
> run before mine.
>
right, it is just grouping.

> But anyway, I have just posted this as an food for thoughts, if it helps or
> not you decide.
>
imo, it would make sense, if we would have that many services as linux has.

>
>
>
> -----
> http://www.cloud208.com/
> --
> View this message in context: http://forum.world.st/Global-session-object-tp4650371p4650580.html
> Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
>



--
Best regards,
Igor Stasenko.

Reply | Threaded
Open this post in threaded view
|

Re: Global session object?

Igor Stasenko
In this case,
would it make sense to have a global "external handles registry"

so, that during image boot it does:

clearExternalObjects and
booting ifTrue: [ registry := registry reject: [:each | each invalidate ] ].

(where registry is WeakIdentitySet , and #invalidate should answer true if
object wants to remove itself (deregister) after invalidating external handle).

and only then doing startup as usual.

like that, then we could have better guarantee that nothing will go wrong,
and things like FreeType won't require own startup procedure at all.

--
Best regards,
Igor Stasenko.

12