Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to ask the presentation compiler nicely
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
martin  
View profile  
 More options Jul 19 2010, 11:28 am
From: martin <oder...@gmail.com>
Date: Mon, 19 Jul 2010 08:28:14 -0700 (PDT)
Local: Mon, Jul 19 2010 11:28 am
Subject: How to ask the presentation compiler nicely
I noted that occasionally the eclipse scala IDE would lock up or crash
with a race condition. The
most common symptom of that was a "key not found" message in
Types.unique. This one I circumvented a while ago. Nevertheless, there
are other potential sources of race conditions.

The issue is that _any_ operation on a symbol, type or tree returned
by the presentation compiler is a potential race condition. Even a
simple member lookup or subtype check can internally change compiler
state, and if that happens concurrently with a presentation compiler
background compile, bad things will happen.

I believe some of the perceived remaining instability of the Eclipse
plugin might be attributable to this problem.

What to do? Any operation on a tree, type or symbol that was returned
by the presentation compiler, and that is more than a simple attribute
value get should be run on the presentation compiler thread.
Previously, there was no easy and fast way to do this, but now there
is: I added an `ask` operation to
scala.tools.nsc.interactive.CompilerControl which will execute the
passed operation as a high priarity "interrupt" on the presentation
compiler thread. You should never have to wait more than a couple of
milliseconds on operations dispatched to `ask`. Here's the signature
of this method:

 def ask[A](op: () => A): A

So where previously you might have written T <:< U, say, you should
now transform this to

  cc.ask(T <:< U)

where `cc` is your instance of the presentation compiler
CompilerControl.

I could not yet test it, so please let me know how it goes.

Cheers

 -- Martin


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jin Mingjian  
View profile  
 More options Jul 19 2010, 11:52 am
From: Jin Mingjian <jin....@gmail.com>
Date: Mon, 19 Jul 2010 23:52:02 +0800
Local: Mon, Jul 19 2010 11:52 am
Subject: Re: [scala-ide-dev] How to ask the presentation compiler nicely

oh, Martin! my recent profiling much support your analysis.
It should be tested with your new rescue method as soon as possible.

2010/7/19 martin <oder...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »