Make eLauncherAuthor thread-safe [patch]

Thomas Leonard <[email protected]>
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
My previous fix (to disable the parsing vat) helped, but I was still
getting some odd errors, so I decided to try and make the previous
three-vat (start, parse, eval) system thread-safe.

I think I've got it working now, although I haven't tested it much
yet. The changes are on my "threading" branch (which branches before
the previous changes I posted about here, because it is an alternative
solution):

  git pull clone
git://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation.git
threading

There are three commits. The first adds a VatSeeder Java class, which
can be passed to Vat.seed and evaluates its twine in privileged scope.
This is needed because safeScope is not thread-safe, so it is never OK
to pass an E object here (as eLauncherAuthor does). It also changes
seedVatAuthor to use the new system:

  http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/8240992d252cdf65311113a6fd910ad468c1e3c8

The next two patches change eLauncherAuthor to use seedVat rather than
Vat.seed. First, the parsing code is split out into a separate file,
loaded by the code given to the VatSeeder:

  http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/1931d74a3830c0df150882b01dabeb5d0cd151fb

Then the eval code, which also removes some duplication between the
run and interpret methods:

  http://gitorious.org/~tal-itinnov/repo-roscidus/it-innovation/commit/4b56a869928d23113fadf1784277c9db9a486f6c

The behaviour of the new system should be almost the same, except that
each thread makes its own new defaultAuths instead of using the ones
passed to eLauncherAuthor.

Does this look like the right approach?


-- 
Dr Thomas Leonard
GPG: 9242 9807 C985 3C07 44A6  8B9A AE07 8280 59A5 3CC1
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.