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
Question on Event Loop in two interpreter.
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
  5 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
 
hahaha  
View profile  
 More options Aug 4 2005, 2:57 am
Newsgroups: comp.lang.tcl
From: hahaha <hah...@haha.com>
Date: Thu, 04 Aug 2005 14:57:06 +0800
Local: Thurs, Aug 4 2005 2:57 am
Subject: Question on Event Loop in two interpreter.
In one interpreter create an sub interpreter. I have question on this,
they use same event loop or individual event loop?

Could I invoke Tcl_DoOneEvent in both interpreter without any problem?


 
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.
Don Porter  
View profile  
 More options Aug 4 2005, 10:20 am
Newsgroups: comp.lang.tcl
From: Don Porter <d...@email.nist.gov>
Date: 4 Aug 2005 14:20:10 GMT
Local: Thurs, Aug 4 2005 10:20 am
Subject: Re: Question on Event Loop in two interpreter.

hahaha wrote:
> In one interpreter create an sub interpreter.

Then those interpreters will be running in the same thread.

> they use same event loop or individual event loop?

At any given time, in one thread, at most one event loop may be
processing events.

There might be several nested event loops "running", but only the
innermost is actually processing events and looking for its termination
condition.

> Could I invoke Tcl_DoOneEvent in both interpreter without any problem?

If you produce nested event loops, be aware that the inner loop must
terminate before the outer one can.  So long as that's acceptable,
there's no problem.

--
| Don Porter          Mathematical and Computational Sciences Division |
| donald.por...@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|


 
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.
hahaha  
View profile  
 More options Aug 4 2005, 9:07 pm
Newsgroups: comp.lang.tcl
From: hahaha <hah...@haha.com>
Date: Fri, 05 Aug 2005 09:07:59 +0800
Local: Thurs, Aug 4 2005 9:07 pm
Subject: Re: Question on Event Loop in two interpreter.
Thanks for your answer, how to implement an nested event loop ?

Don Porter said the following on 8/4/2005 10:20 PM:


 
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.
Don Porter  
View profile  
 More options Aug 4 2005, 9:39 pm
Newsgroups: comp.lang.tcl
From: Don Porter <d...@email.nist.gov>
Date: 5 Aug 2005 01:39:08 GMT
Local: Thurs, Aug 4 2005 9:39 pm
Subject: Re: Question on Event Loop in two interpreter.

hahaha wrote:
>>>Could I invoke Tcl_DoOneEvent in both interpreter without any problem?

Don Porter:

>> If you produce nested event loops, be aware that the inner loop must
>> terminate before the outer one can.  So long as that's acceptable,
>> there's no problem.
hahaha wrote:
> Thanks for your answer, how to implement an nested event loop ?

If you call Tcl_DoOneEvent() at a time when another Tcl_DoOneEvent()
is still running, the call you make is nested within the other one.

--
| Don Porter          Mathematical and Computational Sciences Division |
| donald.por...@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|


 
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.
Melissa Schrumpf  
View profile  
 More options Aug 5 2005, 8:27 am
Newsgroups: comp.lang.tcl
From: Melissa Schrumpf <m_schrumpf_at_yahoo_com_...@microsoft.com>
Date: Fri, 05 Aug 2005 08:27:57 -0400
Local: Fri, Aug 5 2005 8:27 am
Subject: Re: Question on Event Loop in two interpreter.

hahaha wrote:
> Thanks for your answer, how to implement an nested event loop ?

Call [update] while other things are going on?  I think the question is
not so much "how do you create a nested event loop" as "what do you
think that creating a nested event loop will accomplish?

That is, what are you really trying to do?

The only way to get a good answer for what you need to do is to explain
what you're trying to do, not what you think you need to do.  ;-)

It sounds like you're under the impression that "nested" event loops
will give you concurrence.  They won't.  They can, under limited
circumstances, give you the illusion of concurrence.  Used too
liberally, they can also be almost as big of a headache as separate
threads (with the exception that they are determinate).

Think of event loops and [update] as "cooperative multitasking."  Things
will run "at the same time," as long as you speckle your code with
enough calls to [update] (or uses of [after] or [fileevent]) to make it
"seem" like they are running at the same time.  If you put in no
opportunities for one bit to sleep, it won't.  Managing [update]s can be
fairly easy (e.g. a progress bar), but can, on occasion, be tricky,
because you're trying to "synchronize" events to happen when other
procedures enter their event loops.

If what you want is threads, use threads.  If you want determinacy
without locks, at the cost of having to manage "multitasking" yourself,
use event loops.

Incidentally, I would assume, though someone please correct me if I am
wrong, that a single event loop would not take advantage of a MP system,
but threading should?

--
MKS


 
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 »