Skip to content

Conversation

LevchenkoDmitry
Copy link

Решение заключается в том, что просто создаем очередь, в которую помещаем по одной строке.

@AblakatovMikhail
Copy link
Owner

Драйвер вмещает слишком мало сообщений. Возможно, это связано с размером буфера? Можно ли сделать его динамическим?

Запись:

# for i in  $(seq 1 1024) ; do echo "Message $i with some additional text to inc
rease its size" > /dev/dummy ; done
[  104.926591] [OPENING] It has been opened 1 times
[  104.927446] [CLOSING] It has been closed 1 times
[  104.927874] [OPENING] It has been opened 2 times
[  104.928234] [CLOSING] It has been closed 2 times
[  104.928620] [OPENING] It has been opened 3 times





^C[  127.386324] [CLOSING] It has been closed 3 times

# for i in  $(seq 1 8) ; do echo "Message $i with some additional text to increa
se its size" > /dev/dummy ; done
[  136.539992] [OPENING] It has been opened 4 times


^C[  154.797660] [CLOSING] It has been closed 4 times

Чтение:

# while (true) ; do read_msg=$(cat /dev/dummy) ; if [ -z $read_msg ] ; then brea
k ; fi ; echo $read_msg ; done
[  349.362942] [OPENING] It has been opened 5 times
[  349.387248] [CLOSING] It has been closed 5 times
sh: 1: unknown operand
Message 1 with some additional text to increase its size Message 2 with some additional text to increase its size Message 3 with
[  349.410893] [OPENING] It has been opened 6 times
[  349.411277] [CLOSING] It has been closed 6 times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants