This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

async codeing convention

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]