public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* async codeing convention
@ 2001-02-19 19:34 Andrew Cagney
  0 siblings, 0 replies; only message in thread
From: Andrew Cagney @ 2001-02-19 19:34 UTC (permalink / raw)
  To: GDB Discussion

Hmm, a tuffy

If async is going to be implemented, GDB will end up with numerous
chunks of code with asynchronous interfaces.

At present serial.h has the interface:

	serial_read (sd, buffer, len)
		returns SERIAL_TIMEOUT if the
		device isn't ready.

	serial_write (sd, buffer, len)
		At present just assumes the writes don't block :-(

	serial_async (sd, handler, context)
		cal hander() when SD probably has data
		available for reading.
		(The obvious extension is to add
		a write callback).

The interface was selected (internal to Cygnus) because it allowed both
synchronous and asynchronous code to work.

I'd like to establish a convention for how these interfaces should be
implemented.  The obvious move is to just adopt something very similar
to serial.c and I don't have any problems with that :-)

What I'm looking for is comments from people that have hacked on GDB's
existing async code.  However, general comments, such as pointers to
coding standards and examples would also really be appreciated.

	Andrew

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-02-19 19:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-19 19:34 async codeing convention Andrew Cagney

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).