Ensuring canvas safety (using canvas by multiple processes)

Igor Stasenko siguctua at gmail.com
Tue Feb 12 10:13:17 UTC 2008


On 12/02/2008, Michael van der Gulik <mikevdg at gmail.com> wrote:
>
>
> On Feb 12, 2008 11:01 PM, Igor Stasenko <siguctua at gmail.com> wrote:
> >
> >
> > > Anyway, I understand what you mean now. This looks like an
> implementation
> > > issue of your canvas, so the thread protection should be encapsulated
> inside
> > > it.
> > >
> > > I.e.
> > >
> > > myMutex critical: [
> > >     gl changeSomeState.
> > >     ..some code..
> > >     gl revertToPreviousState.
> > > ].
> > >
> >
> > It's still unsafe. Tell you why:
> >
> > myMutex critical: [
> >     gl changeSomeState.
> >     aBlock value.
> >     gl revertToPreviousState.
> >  ].
> >
> > while block still can contain evil forks...
> >
> >
> >
> >
>
>
> Yea, well, don't evaluate untrusted blocks in critical regions :-).
>
> And forks aren't evil. They're quite nice, really; try doing the same in
> Java or C!
>
Sure.

I think, best fit for such needs, i think, is using a proxy, which
value depends on active process.
It's really a most safer approach (since you can't bypass proxy when
interacting with canvas).
The bad, is that proxies are slooow :(

>
> Gulik.
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list