随笔分类 -  进程间通信

摘要:1、什么是socket 我们知道进程通信的方法有管道、命名管道、信号、消息队列、共享内存、信号量,这些方法都要求通信的两个进程位于同一个主机。但是如果通信双方不在同一个主机又该如何进行通信呢?在计算机网络中我们就学过了tcp/ip协议族,其实使用tcp/ip协议族就能达到我们想要的效果,如下图(图片 阅读全文 »
posted @ 2020-03-26 15:20 Smah 阅读(2527) 评论(0) 推荐(0) 编辑
摘要:对TCP/IP、UDP、Socket编程这些词你不会很陌生吧?随着网络技术的发展,这些词充斥着我们的耳朵。那么我想问:1. 什么是TCP/IP、UDP?2. Socket在哪里呢?3. Socket是什么呢?4. 你会使用它们吗?什么是TCP/IP、UDP? TCP/IP(Transmission 阅读全文 »
posted @ 2020-03-26 15:18 Smah 阅读(525) 评论(0) 推荐(0) 编辑
摘要:一、简述 MQTT(Message Queuing Telemetry Transport,消息队列遥测传输协议),是一种基于发布/订阅(publish/subscribe)模式的"轻量级"通讯协议,该协议构建于TCP/IP协议上,由IBM在1999年发布。MQTT最大优点在于,可以以极少的代码和有 阅读全文 »
posted @ 2019-12-30 19:21 Smah 阅读(568) 评论(0) 推荐(0) 编辑
摘要:task_struct英文源码原文 以下是中文以及解释:(未完待续,慢慢敲) 1. /* Used in tsk->state: */ #define TASK_RUNNING 0x0000//进程要么正在执行,要么准备执行,内核中有一个队列,里面都是等待执行的进程。 #define TASK_IN 阅读全文 »
posted @ 2019-12-14 19:34 Smah 阅读(1056) 评论(0) 推荐(1) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2007 IBM Corporation * * Author: Cedric Le Goater <clg@fr.ibm.com> */ #include <linux/nspr 阅读全文 »
posted @ 2019-12-14 19:30 Smah 阅读(225) 评论(0) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2007 * * Author: Eric Biederman <ebiederm@xmision.com> */ #include <linux/module.h> #inclu 阅读全文 »
posted @ 2019-12-14 19:29 Smah 阅读(408) 评论(0) 推荐(0) 编辑
摘要:/* SPDX-License-Identifier: GPL-2.0 */ /* * linux/ipc/util.h * Copyright (C) 1999 Christoph Rohland * * ipc helper functions (c) 1999 Manfred Spraul < 阅读全文 »
posted @ 2019-12-14 19:28 Smah 阅读(341) 评论(0) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0 /* * linux/ipc/util.c * Copyright (C) 1992 Krishna Balasubramanian * * Sep 1997 - Call suser() last after "normal" 阅读全文 »
posted @ 2019-12-14 19:27 Smah 阅读(303) 评论(0) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0 /* * sys_ipc() is the old de-multiplexer for the SysV IPC calls. * * This is really horribly ugly, and new archite 阅读全文 »
posted @ 2019-12-14 19:26 Smah 阅读(591) 评论(1) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0 /* * linux/ipc/shm.c * Copyright (C) 1992, 1993 Krishna Balasubramanian * Many improvements/fixes by Bruno Haible. 阅读全文 »
posted @ 2019-12-14 19:24 Smah 阅读(773) 评论(0) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0 /* * linux/ipc/sem.c * Copyright (C) 1992 Krishna Balasubramanian * Copyright (C) 1995 Eric Schenk, Bruno Haible * 阅读全文 »
posted @ 2019-12-14 19:23 Smah 阅读(668) 评论(0) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0 /* * linux/ipc/namespace.c * Copyright (C) 2006 Pavel Emelyanov <xemul@openvz.org> OpenVZ, SWsoft Inc. */ #include 阅读全文 »
posted @ 2019-12-14 19:22 Smah 阅读(454) 评论(0) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0-or-later /* * linux/ipc/msgutil.c * Copyright (C) 1999, 2004 Manfred Spraul */ #include <linux/spinlock.h> #includ 阅读全文 »
posted @ 2019-12-14 19:19 Smah 阅读(309) 评论(0) 推荐(0) 编辑
摘要:// SPDX-License-Identifier: GPL-2.0 /* * linux/ipc/msg.c * Copyright (C) 1992 Krishna Balasubramanian * * Removed all the remaining kerneld mess * Cat 阅读全文 »
posted @ 2019-12-14 19:18 Smah 阅读(385) 评论(0) 推荐(0) 编辑
摘要:队列的意思应该大家都清楚,不过还有有一些细节的地方不知道,下面是一个队列的源码,因该说这是队列的一部分,不是全部。而且是linux中队列,其他各种OS中队列大同小异。 /* * POSIX message queues filesystem for Linux. * * Copyright (C) 阅读全文 »
posted @ 2019-12-14 19:17 Smah 阅读(682) 评论(0) 推荐(0) 编辑
摘要:在linux的网络编程中,很长的时间都在使用select来做事件触发。在linux新的内核中,有了一种替换它的机制,就是epoll。相比于select,epoll最大的好处在于它不会随着监听fd数目的增长而降低效率。因为在内核中的select实现中,它是采用轮询来处理的,轮询的fd数目越多,自然耗时 阅读全文 »
posted @ 2019-10-17 15:14 Smah 阅读(839) 评论(0) 推荐(0) 编辑
摘要:操作系统内的并发执行进程可以是独立的也可以是协作的: 如果一个进程不能影响其他进程或受其他进程影响,那么该进程是独立的,换句话说,不与任何其他进程共享数据的进程是独立的; 如果一个进程能影响其他进程或受其他进程所影响,那么该进程是协作的。换句话说,与其他进程共享数据的进程为协作进程。 提供环境允许进 阅读全文 »
posted @ 2019-10-17 14:40 Smah 阅读(4337) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示