From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Thompson Newsgroups: gmane.emacs.help Subject: Re: How to exit out of a function ? what is try-catch-throw in terms of Program Counter Date: Sun, 02 Dec 2007 23:20:27 GMT Organization: Poor Message-ID: References: <1192913158.922454.108100@k35g2000prh.googlegroups.com> <13hl1rug786p1f2@corp.supernews.com> <13it94l8vrcqfac@corp.supernews.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1196638851 4197 80.91.229.12 (2 Dec 2007 23:40:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2007 23:40:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 03 00:40:59 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IyyQc-0006d6-Jm for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Dec 2007 00:40:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyyQM-0000Kn-E9 for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2007 18:40:34 -0500 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.news2me.com!cycny01.gnilink.net!spamkiller.gnilink.net!gnilink.net!trnddc02.POSTED!7c706d3b!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.lang.c,comp.lang.c++ X-Newsreader: Forte Agent 3.3/32.846 Original-Lines: 37 Original-NNTP-Posting-Host: 151.204.5.34 Original-X-Complaints-To: abuse@verizon.net Original-X-Trace: trnddc02 1196637627 151.204.5.34 (Sun, 02 Dec 2007 18:20:27 EST) Original-NNTP-Posting-Date: Sun, 02 Dec 2007 18:20:27 EST Original-Xref: shelby.stanford.edu gnu.emacs.help:154354 comp.lang.c:835392 comp.lang.c++:959425 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:49783 Archived-At: On Mon, 05 Nov 2007 06:07:25 +0100, "Alf P. Steinbach" wrote: > * David Thompson: > > On Sun, 21 Oct 2007 00:55:53 +0200, "Alf P. Steinbach" > > wrote: > >> The closest equivalent in C would be a 'longjmp'. However, a C++ > >> exception is more limited, in that it will only jump up the call chain, > > > > C longjmp/setjmp also is only guaranteed to work up the stack; the > > fact that _some_ implementations can work cross-stack and in > > particular cross-thread is not standard nor portable. > > So? > > But also, what on Earth do you mean by a cross-thread longjmp? I > implemented coroutines in terms of longjmp at the time that was popular, > so the concepts involved are not unfamiliar to me. Yet I fail to > envision what you could be talking about, especially as "fact". I think IME 'coroutine' has been used for several slightly different concepts, but if you mean the one of separate threads of control passing CPU ownership often along with data anytime they choose, also known more specifically as cooperative/nonpreemptive threading/tasking, yes. I think you are agreeing that it did actually work, because 'restoring' PC and SP (or equivalents) was enough; but I am pointing out it wasn't and isn't _required_ to work that way. > perhaps you're talking about restoring the full context (registers etc) > of a moment in a thread's execution? > IME a cooperative switch itself doesn't need to save and restore other state, as the language mechanism(s) e.g. 'call yield' handle it. Or for cache-y things it happens automatically, or mostly automatically. - formerly david.thompson1 || achar(64) || worldnet.att.net