of the current thread to pause for a second 1 can achieve the function of N。140 / / sem_post (&bin_sem);141 / / sleep (1);142}143 / / printf ("I am here\n");144 close (FD);145 pthread_exit (NULL);146147}One hundred and forty-eightReaders can compare The reader can find links in the network applications need to end the current of a chat to a chat, and the server can simultaneously N people to chat, although some bug (if the client replies too fast and too frequent, the server will switch to switch to the lock, unable to return to the correct client)。
The client is similar to the server, but relatively simple。 There's no comment here。 I have run these two programs。。。 There's nothing fundamental to the problem。。 But the function is not perfect。。。 Need to improveClient code1 #include<stdio。h>2 #include<stdlib。h>3 #include<sys/socket。h>4 #include<sys/un。h>5 #include<string。h>6 #include<sys/types。h>7 #include<sys/time。h>Eight9, int, main () {10 int result;11 int socketfd;12 int len;13 struct sockaddr_un address;14, fd_set, read_fds, test_fds;15 int fd;16 int max_fds;17 char buffer[1024];Eighteen19 socketfd = socket (AF_UNIX, SOCK_STREAM, 0);Twenty21 address。
因为写进程是在缓冲区的末尾写入,读进程是在缓冲区的头部读取,他们各自。因为写进程是在缓冲区的末尾写入,读进程是在缓冲区的头部读取linux 多线程通信,他们各自 的数据结构不同,所以功能不同。解码子模块对基本流进行变长解码和游程解码,并将解码后的宏块解码参数分别送入变换系数形成子模块和预测数据形成子模块,同时开始启动参考数据的edma读取.变换系数形成子模块根据宏块解码参数,通过游程解码恢复出帧内直流系数和其他系数,并进行反量化,然后将反量化后的数据按照一定扫描顺序写入片内宏块解码临时缓冲区.反扫描后的数据再被送入预测差分值形成子模块,先进行解谐控制,接着进行idct行变换和idct列变换,idct之后的结果仍存在宏块解码临时缓冲区.与此同时,根据宏块参数解码子模块得到的运动矢量值产生参考帧存储器地址和片内参考宏块缓冲区地址,启动参考数据的读取.参考数据开始由edma从片外搬到片内linux 多线程通信,也作为预测数据形成子模块的输入.预测数据形成子模块根据宏块解码参数对参考数据进行半像素内插处理,得到真正的参考值,然后由参考值得到解码宏块的预测数据,保存在宏块解码结果缓冲区.预测合并子模块的输入是预测数据和idct之后保存在解码中间结果缓冲区的预测差分值,这两者根据具体的dct方式进行合并,最终得到当前宏块的解码结果,保存到宏块解码结果缓冲区,同时也作为显示宏块形成子模块的输入.显示宏块形成子模块对4:2:0格式的宏块解码结果进行格式转换,将之前yuv分量分开存放的解码结果转换为4:2:2的按yuyv顺序存放的视频显示结果,保存在宏块显示结果缓冲区,之后输出到片外的显。
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-111969-2.html
小王子