fifo

Which STL container should I use for a FIFO?

十年热恋 提交于 2019-12-17 08:11:04
问题 Which STL container would fit my needs best? I basically have a 10 elements wide container in which I continually push_back new elements while pop_front ing the oldest element (about a million time). I am currently using a std::deque for the task but was wondering if a std::list would be more efficient since I wouldn't need to reallocate itself (or maybe I'm mistaking a std::deque for a std::vector ?). Or is there an even more efficient container for my need? P.S. I don't need random access

FIFO implementation - VHDL

Deadly 提交于 2019-12-14 00:11:56
问题 I come across one more difficulty while instantiate the fifo code to my top module. I want to store some set of data say "WELCOME TO THE WORLD OF FPGA" from my serial port ( receiving subsystem) then i want to retrieve it back say when button on fpga board is pressed or FIFO is full. I have my fifo code and serial communication code written. Idea is data sent from keyboard ->receiving subsystem -> FIFO -> transmitting subsystem -> hyperterminal. I am at present using fifo of 8 bit wide and

FIFO Issue with concurrent processes

帅比萌擦擦* 提交于 2019-12-13 19:43:47
问题 PRETEND THEY'RE NOT PARENT AND CHILD PROCESSES EVEN THOUGH THEY ARE. MAKE FIFO: /* Create response FIFO. */ if (mkfifo(RESP_FIFO_NAME, FIFO_MODE) == -1) { if (errno != EEXIST) { fprintf(stderr, "Server: Couldn’t create %s FIFO.\n", RESP_FIFO_NAME); exit(1); } } Fork: /* 3. Fork the client process. */ switch (fork()) { /* Fork failed. */ case (pid_t) -1: fprintf(stderr, "Call to fork failed.\n"); exit(1); /* Client (child) process. */ case 0: execlp(CLIENT_NAME, CLIENT_NAME, argv[SERVER_CMD

Reading continuous data from a named pipe

僤鯓⒐⒋嵵緔 提交于 2019-12-13 19:11:36
问题 I have been trying to read continuous data from a named pipe. But for some reason if I don't put a delay, the receiver will just stop reading and only a blank screen is shown after a few samples. I need to send continuous data that might change in milliseconds, so that's why putting a delay wouldn't work. I am trying to simulate it first using a while loop (the real script will be reading financial data). This is my first attempt: This is the sender, a python script: import os import time try

C Named pipe (fifo). Parent process gets stuck

北慕城南 提交于 2019-12-13 17:30:27
问题 I want to make a simple program, that fork, and the child writes into the named pipe and the parent reads and displays from the named pipe. The problem is that it enters the parent, does the first printf and then it gets weird, it doesn't do anything else, does not get to the second printf, it just ways for input in the console. #include <string.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> void main() { char t

Cyclic buffer with readers

时光总嘲笑我的痴心妄想 提交于 2019-12-13 16:47:15
问题 I need a cyclic buffer implementation that supports seekable readers. My use case: In my code, I collect log messages. Eventually, the user might visit a page which shows them nicely formatted. To make sure the messages don't fill the RAM, I need a fixed size FIFO structure. If the user doesn't visit the page for a long time, messages get dropped. That's OK. As long as the user stays on the page, new log messages should be appended to the page. Via JavaScript, the user can define how many

Mysql fifo query stock

孤人 提交于 2019-12-13 09:44:48
问题 I have this mysql table and i need a query to know available pcs of every order distinct by type. Is it possible to do? Must work as fifo queue Now i need a query to know how pieces of every order are available ES Order Type Available pcs Planned 16 Cash 10 I buy 5 pcs with order type PLANNED PLANNED+5 I buy 5 pcs with order type CASH CASH+5 I buy 5 pcs with order type CASH CASH+10 I sell 1 pcs PLANNED+4 I sell 1 pcs PLANNED+3 1 sell 2 pcs PLANNED+1 I buy 15 pcs with order type PLANNED

Redirecting stdin through a FIFO

不打扰是莪最后的温柔 提交于 2019-12-12 20:01:47
问题 I'm running a server app (written in Java) under GNU/Linux which takes input (from stdin, I guess) and interprets it to run some commands. I dont want to run the app inside a terminal window (I'd like to run a daemon), but I'd still like to be able to input commands whenever I want to. I thought I might be able to do that using fifos, so I created it using mknod. The problem is cat fifofile > java... and cat fifofile | java ... fail with a "file not found" error for some reason. Using only

During implementing FIFO buffer code for serial communication taking too much time

老子叫甜甜 提交于 2019-12-12 18:54:53
问题 I am a new bee in VHDL coding. I am currently working on starter kit spartan 3e. I have written a code for transmitting 5 bytes to PC and receiving 4 bytes. Now I have to add fifo buffer before transmitting and after receiving bytes.I have written code( taken from Pong P Chu) also but not working. Its taking too much time for synthesis. Please tell me where I am going wrong. Thanks in advance. entity fifo is generic ( B : natural :=32; ---------------------------------------------------

AWS SQS FIFO - How to get more than 10 messages at a time?

筅森魡賤 提交于 2019-12-12 08:14:00
问题 Currently we want to pull down an entire FIFO queue , and process the contents, and if any issues, release messages back into the queue. The problem is, that currently AWS only gives us 10 messages, and won't give us 10 more (which is the way you get bulk messages in SQS, multiple 10 max message requests) until we delete or release the first 10. We need to get more than 10 though. Is this not possible? We understand we can set the group_id to a random string, and that allows processing more,