手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网站运营>建站经验>列表

POSIX Thread Tutorial

来源:互联网 作者:west263.com 时间:2008-04-16
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

Regular files

One process writes data into a file for another process to read [open,read,write].

Mmap'ed files

Processes map a file into their address spaces as a linear array. From what I have read, the resulting performance is usually lousy [mmap].

  • BSD IPC

sockets

There are several varieties of sockets -- the two main families of interest are called UNIX sockets and INET sockets. In the INET family there are TCP (transmission control protocol) and UDP (user datagram protocol) sockets. UNIX and INET/TCP sockets are reliable byte streams; any data that you send via these sockets is guaranteed to to be reassembled at the destination in the proper order. To the user, UNIX and INET/TCP sockets look just like files: you send and receive data with the read() and write() system calls. INET/UDP sockets are unreliable and connectionless but preserve message boundaries. Data that is sent via INET/UDP sockets is not guaranteed to arrive at all. If it does arrive, the entire message arrives at once (messages are limited to about 8 KB). INET/UDP packets may also be duplicated and arrive out of order. Since UDP is connectionless, it is possible to send broadcast messages to all machines on a network. [socket,socketpair]

pipes

A pipe is a pair of connected UNIX sockets set up so that one process writes to the pipe and the other reads from it -- it's unidirectional [pipe]

  • System V IPC

Shared memory segments

Shared memory segments allow different processes to share a common segment of physical memory. This is an exception to the rule that processes are not allowed to peek in on one another's address space. [shmget]

Semaphores

Semaphores are normally used in conjunction with shared memory and are similar in spirit to mutexes (described below). Basically, you use semaphores to serialize access to a piece of shared memory. After reading the rest of this document, you'll understand why this is necessary. [semget]

Message queues

Message queues allow processes to send small messages (16 KB maximum, usually) to one another. [msgget]

Earlier this semester, Anu gave a talk on PVM. PVM is based on IPC mechanisms; e.g., it uses sockets to communicate between processes on different machines across a network. On multiprocessor machines, PVM can be configured to use the System V IPCs to achieve communication between processes on different CPUs. One nice side effect of using these standard mechanisms is that PVM code is fairly portable between UNIX platforms.

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!