async codeing convention

Andrew Cagney ac131313@cygnus.com
Mon Feb 19 19:34:00 GMT 2001


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



More information about the Gdb mailing list