public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Andrew Cagney <cagney@redhat.com>
Cc: frysk <frysk@sourceware.org>
Subject: Re: event-loop thread changing
Date: Thu, 19 Apr 2007 20:10:00 -0000	[thread overview]
Message-ID: <1176993118.4491.33.camel@dijkstra.wildebeest.org> (raw)
In-Reply-To: <462779F6.1090000@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

Hi Andrew,

On Thu, 2007-04-19 at 10:17 -0400, Andrew Cagney wrote:
> I'm not sure I follow.  The calls to .start() I've seen were all 
> intentional:
> 
> - do some stop/start actions with the event-loop in the current thread
> - [later] create a separate event-loop thread
> 
> It is just that with the event-loop handling ptrace, the operation isn't 
> allowed.

Right. And that is why I suggest getting rid of one of the options
(actually it would probably be better to also not make it implement
Runnable if you expect people to not use run() either). Exposing the
EventLoop as a Thread make people believe they can manipulate it as
such, which is clearly not what we intend. So just having one entry
point for starting/stopping (and in the case where people use
Thread.join() a eventloop died notification) makes it so people don't
accidentally do that. And by changing the class type you automatically
catch the bad users. The actual Thread that the event loop uses can then
just be hidden from the user and you could even turn the EventLoop into
a singleton since that is what you seem to want really that once it is
initialized it doesn't "change threads" later on.

Cheers,

Mark

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2007-04-19 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-18  3:30 Andrew Cagney
2007-04-19 13:43 ` Mark Wielaard
2007-04-19 14:32   ` Andrew Cagney
2007-04-19 20:10     ` Mark Wielaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1176993118.4491.33.camel@dijkstra.wildebeest.org \
    --to=mark@klomp.org \
    --cc=cagney@redhat.com \
    --cc=frysk@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).