Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 1999 10:20:04 +0800
From:      miaobo@mail.zhongxing.com
To:        hackers@freebsd.org
Subject:   ASYCH/message-based programming style
Message-ID:  <48256850.000933F2.00@mail.zhongxing.com>

next in thread | raw e-mail | index | archive | help



Hi gurus:
  I am sorry this may be off-topic:
  I think, compared to the application programming style of Win32, which is
asychronize and event/message based, application developing under UNIX is
so different. Here under UNIX, I guess the programmers need to take care of
all sychronization IPC topics in the code, that is, if a process has 2 TCP
socket connection, one pipe, and one SYSV msg id to listen on, the control
of program instruction flow will be hard if we don't want access to
busy-wait situation, Although we can use select() to solve part of the
problem, I think it's not yet enough. And handling asychronize events under
UNIX, such as signal delievery and trapping is hard, the logic of the code
will be unclear, and we only have one asych timer to
use(alarm()/setitimer() share the same timer) and under MT programming we
even need to consider sychronization primitives' ASYN signal or
cancellation safety. So I wonder if there can be any ASYN mechanism in UNIX
application programming in which All incoming I/O and IPC data are
represented by events that contains the "pointer" to data itself, which is
Win32 style like. This maybe hard that it needs modification on kernel,
such as implementation by Solaris2 of POSIX4 aio_read()/aio_write(). Or,
just for historical reasons that UNIX just don't have this kind of
mechanism? As I think, message-based programs is easier to write and the
logic will be clearer.

   Someone told me that message-based procedures are slower than SYCH ones
just like unix does, I don't why they say so if it is true, do you have any
comment about this? That is, can anyone introduce the procedures that, from
NIC receives a packet to applcation's unix blocked read() returns/win32's
application is informed by an event to me?

Thanks in Advance!




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48256850.000933F2.00>