Epoll
Содержание:
EasyPolls (Web)
Best poll app for quickly embedding polls on your website

Embedding polls on your website is an easy way to better understand your customers and gauge satisfaction. You might add new polls depending on the season, new product offerings, or updates to your website. While it’s generally simple to create a poll, it’s a much more manual process to create the poll, copy the new embed code, go to the right pages, and replace the old code with the new. EasyPolls has a solution with its «poll container» feature.
A poll container is a piece of code that you generate in EasyPolls and then embed on your website—just once. Then, every time you create a new poll, you can add it to that container instead of editing each page with the new embed code.
To use the poll containers, you first need to have some active polls attached to your EasyPolls account. Creating a new poll is easy: Navigate to the Poll tab, enter your question and answers, customize the poll’s appearance by selecting one of 21 themes or building your own, and click Save (you’ll need to sign up for an account or log in to save your polls).
Then, to create a poll container, navigate to the Containers tab on the EasyPolls site, enter your container name, and click Create poll container. You’ll see that the container was created, but that it shows as Empty. Click the gear icon, and all your saved polls will appear. Then click the name of the poll you want to add to the container and—voilà—it will appear in the container on your website.
Note: a container can only have one poll at a time, but you can have the same poll placed in multiple containers.
EasyPolls Pricing: Free
USB device speed
USB devices are designed to operate at a certain bitrate. Many pointing devices are «Low Speed» 1.5Mbit/s devices. The speed of a device can be shown as explained in .
«Low Speed» devices may not be capable of polling at intervals less than 8ms.
All USB hubs should be capable of at least «Full Speed» 12Mbit/s. The speed of the hub that the device is attached to can be shown with the following command with the same as the device:
# grep -B1 -A10 "Bus=01 Lev=00" /sys/kernel/debug/usb/devices
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2 B: Alloc= 11/900 us ( 1%), #Int= 1, #Iso= 0 D: Ver= 1.10 Cls=09(hub ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=1d6b ProdID=0001 Rev= 4.01 S: Manufacturer=Linux 4.1.18-1-lts uhci_hcd S: Product=UHCI Host Controller S: SerialNumber=0000:00:10.0 C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub E: Ad=81(I) Atr=03(Int.) MxPS= 2 Ivl=255ms
The of the hub is independent of the device and does not affect the polling rate of the device.
Poll Everywhere (Web, Android, iOS, PowerPoint, Keynote, Google Slides)
Best poll app for adding polls to your presentations

Polling a live audience? Poll Everywhere makes presentations interactive by replacing the classic hand raise. Create a poll on its website, and add the Poll Everywhere widget to your PowerPoint, Keynote, or Google Slides presentation. Ask the audience your question during your presentation, and they can answer by loading the poll on their phone’s browser or texting in a response.
Poll responses are shown to the audience in real time inside your presentation to keep your audience engaged. If you choose to make an open-ended poll (or one with an «Other» field), you can select which responses show on your presentation, filtering out inappropriate or off-topic responses.
Poll Everywhere Pricing: Free for 25 responses per poll; from $19/month for the Basic plan that includes 50 responses.
Polling rate and polling interval
The polling rate of a device is measured in Hertz (Hz) and is determined by the polling interval. The polling interval is measured in milliseconds (ms) and equates to lag time.
The default polling interval is 10ms. However, USB controllers round the interval down to the nearest power of two. Thus, an interval setting of 10ms will actually use 8ms, 7ms will use 4ms, etc.
The following table shows the relation between polling rate Hertz and the corresponding interval milliseconds (rate = 1000 / interval).
| Hz | 1000 | 500 | 250 | 125 |
|---|---|---|---|---|
| ms | 1 | 2 | 4 | 8 |
If the polling rate is 125 Hz, the mouse position will be updated every 8 milliseconds. In situations where lag is critical—for example games—some users decrease the interval to as little as possible. However, this puts more load on the CPU, so care should be taken when adjusting this value.
epoll_create
epoll_create用于创建一个epoll的句柄,其在内核的系统实现如下:
sys_epoll_create:
可见,我们在调用epoll_create时,传入的size参数,仅仅是用来判断是否小于等于0,之后再也没有其他用处。
整个函数就3行代码,真正的工作还是放在sys_epoll_create1函数中。
sys_epoll_create -> sys_epoll_create1:
sys_epoll_create1 函数流程如下:
首先调用ep_alloc函数申请一个eventpoll结构,并且初始化该结构的成员,这里没什么好说的,代码如下:
sys_epoll_create -> sys_epoll_create1 -> ep_alloc:
接下来调用get_unused_fd_flags函数,在本进程中申请一个未使用的fd文件描述符。
sys_epoll_create -> sys_epoll_create1 -> ep_alloc -> get_unused_fd_flags:
linux内核中,current是个宏,返回的是一个task_struct结构(我们称之为进程描述符)的变量,表示的是当前进程,进程打开的文件资源保存在进程描述符的files成员里面,所以current->files返回的当前进程打开的文件资源。rlimit(RLIMIT_NOFILE) 函数获取的是当前进程可以打开的最大文件描述符数,这个值可以设置,默认是1024。
__alloc_fd的工作是为进程在[start,end)之间(备注:这里start为0, end为进程可以打开的最大文件描述符数)分配一个可用的文件描述符,这里就不继续深入下去了,代码如下:
sys_epoll_create -> sys_epoll_create1 -> ep_alloc -> get_unused_fd_flags -> __alloc_fd:
然后,epoll_create1会调用anon_inode_getfile,创建一个file结构,如下:
sys_epoll_create -> sys_epoll_create1 -> anon_inode_getfile:
anon_inode_getfile函数中首先会alloc一个file结构和一个dentry结构,然后将该file结构与一个匿名inode节点anon_inode_inode挂钩在一起,这里要注意的是,在调用anon_inode_getfile函数申请file结构时,传入了前面申请的eventpoll结构的ep变量,申请的file->private_data会指向这个ep变量,同时,在anon_inode_getfile函数返回来后,ep->file会指向该函数申请的file结构变量。
简要说一下file/dentry/inode,当进程打开一个文件时,内核就会为该进程分配一个file结构,表示打开的文件在进程的上下文,然后应用程序会通过一个int类型的文件描述符来访问这个结构,实际上内核的进程里面维护一个file结构的数组,而文件描述符就是相应的file结构在数组中的下标。
dentry结构(称之为“目录项”)记录着文件的各种属性,比如文件名、访问权限等,每个文件都只有一个dentry结构,然后一个进程可以多次打开一个文件,多个进程也可以打开同一个文件,这些情况,内核都会申请多个file结构,建立多个文件上下文。但是,对同一个文件来说,无论打开多少次,内核只会为该文件分配一个dentry。所以,file结构与dentry结构的关系是多对一的。
同时,每个文件除了有一个dentry目录项结构外,还有一个索引节点inode结构,里面记录文件在存储介质上的位置和分布等信息,每个文件在内核中只分配一个inode。 dentry与inode描述的目标是不同的,一个文件可能会有好几个文件名(比如链接文件),通过不同文件名访问同一个文件的权限也可能不同。dentry文件所代表的是逻辑意义上的文件,记录的是其逻辑上的属性,而inode结构所代表的是其物理意义上的文件,记录的是其物理上的属性。dentry与inode结构的关系是多对一的关系。
最后,epoll_create1调用fd_install函数,将fd与file交给关联在一起,之后,内核可以通过应用传入的fd参数访问file结构,本段代码比较简单,不继续深入下去了。
sys_epoll_create -> sys_epoll_create1 -> fd_install:
总结epoll_create函数所做的事:调用epoll_create后,在内核中分配一个eventpoll结构和代表epoll文件的file结构,并且将这两个结构关联在一块,同时,返回一个也与file结构相关联的epoll文件描述符fd。当应用程序操作epoll时,需要传入一个epoll文件描述符fd,内核根据这个fd,找到epoll的file结构,然后通过file,获取之前epoll_create申请eventpoll结构变量,epoll相关的重要信息都存储在这个结构里面。接下来,所有epoll接口函数的操作,都是在eventpoll结构变量上进行的。
所以,epoll_create的作用就是为进程在内核中建立一个从epoll文件描述符到eventpoll结构变量的通道。
Installation
Download the ES module file …
curl -O https://raw.githubusercontent.com/kleinfreund/poll/main/dist/esm/poll.mjs
… and import it like this:
importpollfrom'poll.mjs';functionfn(){console.log('Hello, beautiful!');};poll(fn,1000);
Install the node package as a dependency …
npm install --save poll
… and import it like this:
-
CommonJS module
const poll = require('poll').default;function fn() { console.log('Hello, beautiful!');};poll(fn, 1000); -
ES module
importpollfrom'poll/dist/esm/poll.mjs';functionfn(){console.log('Hello, beautiful!');};poll(fn,1000); -
TypeScript module
importpollfrom'poll/src/poll';functionfn(){console.log('Hello, beautiful!');};poll(fn,1000);
Описание epoll API
Linux предоставляет следующие вызовы в рамках API:
- epoll_create() — создаёт структуру данных (epoll instance), с которой в дальнейшем идёт работа. Структура одна для всех файловых дескрипторов, за которыми идёт наблюдение. Функция возвращает файловый дескриптор, который в дальнейшем передаётся во все остальные вызовы epoll API.
- epoll_ctl() — используется для управления epoll instance, в частности, позволяет выполнять операции EPOLL_CTL_ADD (добавление файлового дескриптора к наблюдению), EPOLL_CTL_DEL (удаление файлового дескриптора из наблюдения), EPOLL_CTL_MOD (изменение параметров наблюдения), EPOLL_CTL_DISABLE (добавлена в Linux 3.7) — для безопасного отключения наблюдения за файловым дескриптором в многопоточных приложениях
- epoll_wait() — возвращает количество (один или более) файловых дескрипторов из списка наблюдения, у которых поменялось состояние (которые готовы к вводу-выводу).
- Прототипы функций
Принцип работы: после того, как приложение добавляет дескрипторы к наблюдению и вызывает epoll_wait(), при готовности какого-либо дескриптора (появлению информации, опустошению буфера и т. д.) ядро возвращает приложение из epoll_wait со списком файловых дескрипторов, которые готовы к работе. Если какие-то дескрипторы становятся готовыми к работе до вызова epoll_wait, то они отмечаются соответствующим образом и при следующем вызове epoll_wait управление в приложение возвращается сразу же со списком готовых к работе файловых дескрипторов.
События, за которыми можно наблюдать с помощью epoll:
- EPOLLIN — новые данные (для чтения) в файловом дескрипторе
- EPOLLOUT — файловый дескриптор готов продолжить принимать данные (для записи)
- EPOLLERR — в файловом дескрипторе произошла ошибка
- EPOLLHUP — закрытие файлового дескриптора
Example — Interrupts Per Second
In this example, GPIO #7 is wired to one end of a 1kΩ current limiting
resistor and GPIO #8 is wired to the other end of the resistor. GPIO #7 is an
input and GPIO #8 is an output.
The first step is to export GPIOs #7 and #8 using the export bash script from
the examples directory.
export:
echo 7 > /sys/class/gpio/exportecho 8 > /sys/class/gpio/exportsleep 1echoin> /sys/class/gpio/gpio7/directionecho both > /sys/class/gpio/gpio7/edgeecho out > /sys/class/gpio/gpio8/direction
Then run interrupts-per-second. interrupts-per-second toggles the state of the
output every time it detects an interrupt on the input. Each toggle will
trigger the next interrupt. After five seconds, interrupts-per-second prints
the number of interrupts it detected per second.
interrupts-per-second:
constEpoll=require('../../').Epoll;constfs=require('fs');constvalue=Buffer.alloc(1);constzero=Buffer.from('');constone=Buffer.from('1');constinputfd=fs.openSync('/sys/class/gpio/gpio7/value','r+');constoutputfd=fs.openSync('/sys/class/gpio/gpio8/value','r+');let count =;constpoller=newEpoll((err,fd,events)=>{ count +=1;fs.readSync(inputfd, value,,1,);constnextValue= value=== zero?one zero;fs.writeSync(outputfd, nextValue,,nextValue.length,);});let time =process.hrtime();poller.add(inputfd,Epoll.EPOLLPRI);setTimeout(_=>{ time =process.hrtime(time);constrate=Math.floor(count (time+ time11E9));console.log(rate +' interrupts per second');poller.remove(inputfd).close();},5000);
When interrupts-per-second has terminated, GPIOs #7 and #8 can be unexported
using the unexport bash script.
unexport:
echo 7 > /sys/class/gpio/unexportecho 8 > /sys/class/gpio/unexport
Here are some results from the «Interrupts Per Second» example.
Raspberry Pi 3, 1.2Ghz, Raspbian:
| node | epoll | kernel | interrupts / sec |
|---|---|---|---|
| v10.7.0 | v2.0.2 | 4.14.50-v7+ | 22468 |
| v8.11.3 | v2.0.2 | 4.14.50-v7+ | 21022 |
| v6.14.3 | v2.0.2 | 4.14.50-v7+ | 22745 |
API
- Epoll(callback) — Constructor. The callback is called when epoll events
occur and it gets three arguments (err, fd, events). - add(fd, events) — Register file descriptor fd for the event types specified
by events. - remove(fd) — Deregister file descriptor fd.
- modify(fd, events) — Change the event types associated with file descriptor
fd to those specified by events. - close() — Deregisters all file descriptors and free resources.
Event Types
- Epoll.EPOLLIN
- Epoll.EPOLLOUT
- Epoll.EPOLLRDHUP
- Epoll.EPOLLPRI
- Epoll.EPOLLERR
- Epoll.EPOLLHUP
- Epoll.EPOLLET
- Epoll.EPOLLONESHOT
Event types can be combined with | when calling add or modify. For example,
Epoll.EPOLLPRI | Epoll.EPOLLONESHOT could be passed to add to detect a single
GPIO interrupt.
Documentation
Parameters:
-
function: Required. A function to be called every milliseconds. No parameters are passed to upon calling it.
-
delay: Required. The delay (in milliseconds) to wait before calling the function again. If is negative, zero will be used instead.
-
shouldStopPolling: Optional. A function indicating whether to stop the polling process. The callback function is evaluated twice during one iteration of the internal loop:
- After the result of the call to was successfully awaited. In other words, right before triggering a new delay period.
- After the has passed. In other words, right before calling again.
This guarantees two things:
- A currently active execution of will be completed.
- No new calls to will be triggered.
Return value:
None.
Обратная сторона медали
- Потоки выполнения в блокирующей модели имеют относительно короткий жизненный цикл и рано или поздно освобождают выделенную им память, процесс обработки неблокирующих соединений живет существенно дольше и намного более уязвим для утечек памяти.
- Использование одного системного процесса без пула потоков выполнения ограничивает приложение использованием лишь одного процессорного ядра, что делает такой подход менее пригодным для приложений, в значительной мере использующих вычислительные ресурсы. В большинстве же случаев приемлемым решением является запуск нескольких одинаковых копий приложения на одном сервере по количеству процессорных ядер.
- Ошибки в коде могут негативно повлиять на работу всего процесса приложения, в то время как в блокирующей модели потоки выполнения обычно достаточно изолированы друг от друга.
What Makes a Great Poll App?
While social media polls are often the best option, sometimes you need a more robust polling tool to collect additional data about your audience, conduct polls on the go, or liven up a presentation. There are quite a few of these on the market, and we tested more than fifteen of the most popular. We looked for poll apps that:
- Are easy to use
- Offer a unique feature above and beyond the standard polling options
- Include more robust features than social media polls
This roundup focuses purely on poll apps. While you can use traditional survey tools to create one-question polls, those survey apps typically offer features you don’t need to create a simple poll.
Reviews
http-equiv=»Content-Type» content=»text/html;charset=UTF-8″>lass=»plugin-reviews»>
Даже бесплатная версия вполне годится для использования.
Free version SUCKS, you can only ask one question at a time. «open source»… yeah right
I think this plugin is best for adding a quick poll or survey to your website. It works quite intuitively and the plugin is overall very clean. I’ve purchased the pro version and I had some questions related to the video poll option — amazing how quick the YOP team replies and came with solutions. Definitely one of my favorite plugins.
I have checked different free and paid plugins but it did not work for me.
Why I like YOP Poll because it is:
>Superfast 100% responsive support. (I am impressed)
>User friendly
>Customizable
>Easy to understand
>Simple to use
>Prebuild templates
>evry type of poll/survey creation
>No effect on your website performance or layout
Will highly recommend YOP Poll.
I had the free version and had a few small issues, but it worked and did the job. The customer service even for the free version was outstanding. I wanted the countdown timer and the fingerprint for voters so I purchased the pro version. This plugin works great and all issues have been corrected.
I would recommend this plugin for anyone wishing to have polls on the website.
I bought the pro version but I’m disappointed myself because it doesn’t offer graphics. It was urgent for me and I ordered. Wasted money
epoll_wait
epoll_wait等待事件的产生,内核代码如下:
sys_epoll_wait:
首先是对进程传进来的一些参数的检查:
- maxevents必须大于0并且小于EP_MAX_EVENTS,否则就返回-EINVAL;
- 内核必须有对events变量写文件的权限,否则返回-EFAULT;
- epfd代表的文件必须是个真正的epoll文件,否则返回-EBADF。
参数全部检查合格后,接下来就调用ep_poll函数进行真正的处理:
sys_epoll_wait -> ep_poll:
ep_poll中首先是对等待时间的处理,timeout超时时间以ms为单位,timeout大于0,说明等待timeout时间后超时,如果timeout等于0,函数不阻塞,直接返回,小于0的情况,是永久阻塞,直到有事件产生才返回。
当没有事件产生时((!ep_events_available(ep))为true),调用__add_wait_queue_exclusive函数将当前进程加入到ep->wq等待队列里面,然后在一个无限for循环里面,首先调用set_current_state(TASK_INTERRUPTIBLE),将当前进程设置为可中断的睡眠状态,然后当前进程就让出cpu,进入睡眠,直到有其他进程调用wake_up或者有中断信号进来唤醒本进程,它才会去执行接下来的代码。
如果进程被唤醒后,首先检查是否有事件产生,或者是否出现超时还是被其他信号唤醒的。如果出现这些情况,就跳出循环,将当前进程从ep->wp的等待队列里面移除,并且将当前进程设置为TASK_RUNNING就绪状态。
如果真的有事件产生,就调用ep_send_events函数,将events事件转移到用户空间里面。
sys_epoll_wait -> ep_poll -> ep_send_events:
ep_send_events没有什么工作,真正的工作是在ep_scan_ready_list函数里面:
sys_epoll_wait -> ep_poll -> ep_send_events -> ep_scan_ready_list:
ep_scan_ready_list首先将ep就绪链表里面的数据链接到一个全局的txlist里面,然后清空ep的就绪链表,同时还将ep的ovflist链表设置为NULL,ovflist是用单链表,是一个接受就绪事件的备份链表,当内核进程将事件从内核拷贝到用户空间时,这段时间目标文件可能会产生新的事件,这个时候,就需要将新的时间链入到ovlist里面。
仅接着,调用sproc回调函数(这里将调用ep_send_events_proc函数)将事件数据从内核拷贝到用户空间。
sys_epoll_wait -> ep_poll -> ep_send_events -> ep_scan_ready_list -> ep_send_events_proc:
ep_send_events_proc回调函数循环获取监听项的事件数据,对每个监听项,调用ep_item_poll获取监听到的目标文件的事件,如果获取到事件,就调用__put_user函数将数据拷贝到用户空间。
回到ep_scan_ready_list函数,上面说到,在sproc回调函数执行期间,目标文件可能会产生新的事件链入ovlist链表里面,所以,在回调结束后,需要重新将ovlist链表里面的事件添加到rdllist就绪事件链表里面。
同时在最后,如果rdlist不为空(表示是否有就绪事件),并且由进程等待该事件,就调用wake_up_locked再一次唤醒内核进程处理事件的到达(流程跟前面一样,也就是将事件拷贝到用户空间)。
到这,epoll_wait的流程是结束了,但是有一个问题,就是前面提到的进程调用epoll_wait后会睡眠,但是这个进程什么时候被唤醒呢?在调用epoll_ctl为目标文件注册监听项时,对目标文件的监听项注册一个ep_ptable_queue_proc回调函数,ep_ptable_queue_proc回调函数将进程添加到目标文件的wakeup链表里面,并且注册ep_poll_callbak回调,当目标文件产生事件时,ep_poll_callbak回调就去唤醒等待队列里面的进程。
总结一下epoll该函数: epoll_wait函数会使调用它的进程进入睡眠(timeout为0时除外),如果有监听的事件产生,该进程就被唤醒,同时将事件从内核里面拷贝到用户空间返回给该进程。
ERRORS
- EBADF
-
epfd
or
fdis not a valid file descriptor.
- EEXIST
-
op
was
EPOLL_CTL_ADD,and the supplied file descriptor
fdis already registered with this epoll instance.
- EINVAL
-
epfd
is not an
epollfile descriptor,
or
fdis the same as
epfd,or the requested operation
opis not supported by this interface.
- EINVAL
-
An invalid event type was specified along with
EPOLLEXCLUSIVEin
events. - EINVAL
-
op
was
EPOLL_CTL_MODand
eventsincluded
EPOLLEXCLUSIVE. - EINVAL
-
op
was
EPOLL_CTL_MODand the
EPOLLEXCLUSIVEflag has previously been applied to this
epfd, fdpair.
- EINVAL
-
EPOLLEXCLUSIVE
was specified in
eventand
fdrefers to an epoll instance.
- ELOOP
-
fd
refers to an epoll instance and this
EPOLL_CTL_ADDoperation would result in a circular loop of epoll instances
monitoring one another. - ENOENT
-
op
was
EPOLL_CTL_MODor
EPOLL_CTL_DEL,and
fdis not registered with this epoll instance.
- ENOMEM
-
There was insufficient memory to handle the requested
opcontrol operation.
- ENOSPC
-
The limit imposed by
/proc/sys/fs/epoll/max_user_watcheswas encountered while trying to register
(EPOLL_CTL_ADD)a new file descriptor on an epoll instance.
See
epoll(7)for further details.
- EPERM
-
The target file
fddoes not support
epoll.This error can occur if
fdrefers to, for example, a regular file or a directory.
Set polling interval
To configure the polling rate use the option of the kernel module. The default value is 0 which means the module uses the interval requested by the device(s).
The current value of the option can be verified with:
$ systool -m usbhid -A mousepoll
Module = "usbhid"
mousepoll = "0"
To change the configuration create the following file:
/etc/modprobe.d/usbhid.conf
options usbhid mousepoll=4
This example requests a polling rate of 250Hz. Similarly, you may use jspoll or kbpoll to change the polling rate of gamepads/joysticks or keyboards.
To change the polling interval without rebooting
# modprobe -r usbhid && modprobe usbhid
Warning: If the second command fails you will be unable to use any USB mouse or keyboard and may have to reboot or ssh into your machine.
You may have to unplug the mouse and plug it back in for the change to take effect.
Note: If the usbhid module is included on your initramfs image you may need to add to the image also. See the note at . Alternatively, you can add to your kernel command line. See .
Example — Watching Buttons
The first step is to export GPIO #4 as an interrupt generating input using
the export bash script from the examples directory.
export:
echo 4 > /sys/class/gpio/exportsleep 1echoin> /sys/class/gpio/gpio4/directionecho both > /sys/class/gpio/gpio4/edge
Then run watch-button to be notified every time the button is pressed and
released. If there is no hardware debounce circuit for the push-button, contact
bounce issues are very likely to be visible on the console output.
watch-button terminates automatically after 30 seconds.
watch-button:
constEpoll=require('epoll').Epoll;constfs=require('fs');constvaluefd=fs.openSync('/sys/class/gpio/gpio4/value','r');constbuffer=Buffer.alloc(1);constpoller=newEpoll((err,fd,events)=>{fs.readSync(fd, buffer,,1,);console.log(buffer.toString()==='1'?'pressed''released');});fs.readSync(valuefd, buffer,,1,);poller.add(valuefd,Epoll.EPOLLPRI);setTimeout(_=>{poller.remove(valuefd).close();},30000);
When watch-button has terminated, GPIO #4 can be unexported using the
unexport bash script.
unexport:
echo 4 > /sys/class/gpio/unexport
COLOPHON top
This page is part of release 5.08 of the Linux man-pages project. A
description of the project, information about reporting bugs, and the
latest version of this page, can be found at
https://www.kernel.org/doc/man-pages/.
Linux 2019-03-06 EPOLL(7)
Pages that refer to this page:
accept(2),
accept4(2),
creat(2),
epoll_create1(2),
epoll_create(2),
epoll_ctl(2),
epoll_pwait(2),
epoll_wait(2),
eventfd2(2),
eventfd(2),
futex(2),
kcmp(2),
_newselect(2),
open(2),
openat(2),
perf_event_open(2),
perfmonctl(2),
pidfd_open(2),
poll(2),
ppoll(2),
pselect(2),
pselect6(2),
recv(2),
recvfrom(2),
recvmsg(2),
select(2),
select_tut(2),
signalfd(2),
signalfd4(2),
timerfd_create(2),
timerfd_gettime(2),
timerfd_settime(2),
userfaultfd(2),
eventfd_read(3),
eventfd_write(3),
fd_clr(3),
FD_CLR(3),
fd_isset(3),
FD_ISSET(3),
fd_set(3),
FD_SET(3),
fd_zero(3),
FD_ZERO(3),
sd-event(3),
sd_event_add_io(3),
sd_event_get_fd(3),
sd_event_io_handler_t(3),
sd_event_source(3),
sd_event_source_get_io_events(3),
sd_event_source_get_io_fd(3),
sd_event_source_get_io_fd_own(3),
sd_event_source_get_io_revents(3),
sd_event_source_set_io_events(3),
sd_event_source_set_io_fd(3),
sd_event_source_set_io_fd_own(3),
proc(5),
procfs(5),
systemd.exec(5),
capabilities(7),
fanotify(7),
inotify(7),
mq_overview(7),
pipe(7),
socket(7),
udp(7)
Polltab (Web)
Best poll app for authenticated voting

Whether you embed a poll on your website, share it directly on social media, or direct users to a link, you always run the risk of spam votes. Online trolls may flood your poll with fake answers or bots may overtake it. You can add safeguards, like restricting multiple votes from the same IP address or adding a CAPTCHA form, but Polltab takes it one step further by requiring that participants log in to their Google, Facebook, Reddit, or Twitch account before they can cast a vote.
Enter your poll question and answer options, and a live preview will appear on the right side of the screen. Then, use the slider at the bottom of the poll-builder to set the level of voting security. Slide it all the way to the left to allow unlimited voting. Slide it to farther to the right to require a Google, Facebook, Reddit, or Twitch login to vote. For whichever third-party authentication you select, the Vote button in the live preview will dynamically update. For example, if you require a Reddit login, the button will change to say Vote with Reddit.
When you’re ready to publish your poll, you’ll get a customized URL you can distribute. There’s not a clear way to view the poll’s results, so as a workaround, if you add to the end of your poll’s URL, you’ll be able to see the votes as they come in.
Polltab Pricing: Free
Xoyondo (Web)
Best poll app for seeing exactly who voted for what

Polls are most often used to get an aggregated view of people’s preferences. For example, you want to find out if people prefer creamy peanut butter over crunchy. You don’t care who voted for creamy or crunchy—you just want to know which one won the majority of the votes.
But there are some scenarios where you would want to know exactly who voted for what. What if you’re using a poll to capture lunch preferences? Or plan a family vacation? In these cases, knowing what each person voted for can help your decision-making process.
With Xoyondo, you can create «opinion polls» that let you see which respondents voted for which option. These opinion polls are set up exactly like Doodle, the online calendar tool (but the two apps are not affiliated with each other).
Opinion polls are free to create, and you don’t even need a Xoyondo account. But if you plan on creating multiple polls, you might as well sign up for the free account to better manage and organize your polls in one place (versus having to go back to each individual poll link to see the responses).
When your poll is complete, you will get two links: one to share with participants and one for you to go back and make edits to the poll. As votes start coming in, you’ll see the results in a tabular format. The names of each participant will be in a column on the left side, the answer options will be a row that runs at the top of the table, and the middle of the table will display a green checkmark for the options that were chosen and red X’s for those that were not.
Xoyondo Pricing: Free
Thanks to social media, it’s easier than ever to get quick answers to your questions and poll your audience. With dedicated poll apps, you can get more detailed responses and learn more from your poll. Next time you need to find out what the world thinks, these tools will help you get your answer quickly.
Originally published in February 2018 by Andrew Kunesh, this post was updated in February 2019 with each app’s latest features and pricing, and with great new poll apps including EasyPolls, Polltab, and Xoyondo. Image Credits: Header photo by Lukas via Pexels.
Examples
The function expects two parameters: A callback function and a delay. After calling with these parameters, the callback function will be called. After it’s done being executed, the function will wait for the specified . After the delay, the process starts from the beginning.
constpollDelayInMinutes=10;asyncfunctiongetStatusUpdates(){constresponse=awaitfetch('/status');console.log(response);}poll(getStatusUpdates, pollDelayInMinutes *60*1000);
Note that will not cause a second call to the callback function if the first call is still not finished. For example, it the endpoint does not respond and the server doesn’t time out the connection, will still be waiting for the callback function to fully resolve. It will not start the delay until the callback function is finished.
You can pass a callback function to for its last parameter. Its evaluated before and after calls to the polled function. If it evaluates to , the function’s loop will stop and the function returns.
In the following example, the callback function evaluates to after the function called its anonymous callback function which sets to . The next time is evaluated, it will cause to exit normally.
constpollDelayInMinutes=10;conststopPolling=false;constshouldStopPolling=()=> stopPolling;functionfn(){console.log('Hello, beautiful!');}setTimeout(()=>{ stopPolling =true;},1000);poll(fn,50, shouldStopPolling);
Poll Junkie (Web)
Best poll app for creating free polls without an account

Poll Junkie will help you make quick polls for free—without registering for an account but with more features than social media polls offer.
In terms of question types, you can choose from multiple choice, 1-10 rating, ranking (1st, 2nd, 3rd…), or open text, and Poll Junkie saves your work as you go. You can exit your browser and come back to Poll Junkie later, where it will prompt you to continue where you left off.
While the website is no-frills and the features may seem basic, Poll Junkie gets the job done and doesn’t require you to sign up for yet another app. Plus, other free poll apps often don’t allow you to save your work as you go, choose from multiple question types, or give you an easy way to view results.
Poll Junkie Pricing: Free
Known issues
Polling rate not changing
The module should respect the interval requested by the device, so check the documentation for the device for a hardware or firmware setting.
Another work-around is to disable xHCI. There might be a BIOS setting for this or you can do so by blacklisting the module. However, either way will cause any USB 3 ports to act as USB 2 as the kernel will use the module instead.
Tip: To see which drivers are in use see the line for hub devices in .
Polling rate resulting in lag with wine
It is not possible to change the poll rate of the mouse using the methods within this wiki (the «usbhid» method), if your computer only has a USB3 xHCI Controller.
Unfortunately there is currently no fix for users with a combination of a mouse with a high poll rate and only a USB3 xHCI Controller.
A workaround is to use a mouse with a lower poll rate.
На пальцах
Вернемся к изначальному вопросу статьи: Как работает epoll? Давайте попробуем разобрать на простом примере.
Представьте себе пиццерию(физический сервер). Вы(приложение или HTTP-сервер) получаете заказы(обращения на сокет, например HTTP-запрос) на выпечку пиццы(ответы на обращение, например HTML-документы). Есть два сценария, по которым можно их обрабатывать.
Блокирующий (традиционный)
Вы принимаете заказ, ставите пиццу в печь(системные ресурсы, в.т.ч. оперативная память, необходимые для обработки запроса) и непрерыано наблюдаете за тем как пицца печется. Как только пицца готова — вы берете её и отдаете в руки заказчику (источник заказа, например браузер), после чего принимаете следующий заказ. При необходимости можно нанять помощников(потоки выполнения, threads), чтобы следить за выпеканием пицц.
Вы ограничены как количеством печей, так и количеством помощников, которые могут поместиться в вашей пиццерии.
Неблокирующий (epoll и аналоги)
Вы принимаете заказ, ставит пиццу в печь и ставите таймер(операционная система посредством epoll), чтобы узнать когда пицца испечется. После чего Вы возвращаетесь к приему заказов. Как только прозвенел таймер — Вы идете к соответствующей печи, достаете пиццу и отдаете заказчику, после чего снова возвращаетесь к приему заказов.
При таком подходе Вы ограничены лишь количеством печей и не нуждаетесь в помощниках, хотя если срабатывает несколько таймеров одновременно могут появлятся дополнительные задержки. В качестве бонуса легко готовить пиццы, требующие длительного времени выпекания.
Description
YOP Poll plugin allows you to easily integrate a survey in your blog post/page and to manage the polls from within your WordPress dashboard but if offers so much more than other similar products. Simply put, it doesn’t lose sight of your needs and ensures that no detail is left unaccounted for.
To name just a few improvements, you can create polls to include both single or multiple answers, work with a wide variety of options and settings to decide how you wish to sort your poll information, how to manage the results, what details to display and what to keep private, whether you want to view the total votes or the total voters, to set vote permissions or block voters etc.
Scheduling your polls is no longer a problem. YOP Poll can simultaneously run multiple polls (no limit included) or you can schedule your polls to start one after another. Also, keeping track of your polls is easy, you have various sorting functions and you can access older versions at any time.
Designed to intuitive and easy to use, this plugin allows shortcodes and includes a widget functionality that fits perfectly with your WordPress website. For more details on the included features, please refer to the description below.
Current poll features:
[править] Заключение
Лучше один раз увидеть, чем сто раз услышать — тут картинка с результатом работы программы-теста.
ИТОГИ:
Приветствуются любая критика и замечания — maksud.nurullaevgmail.com
P.S.
если при запуске теста, система будет ругаться на большое количество одновременно открытых файлов(дескрипторов), проверьте свои лимиты через ulimit -n и измените на подходящее значение;
- тексты программ изобилуют комментариями, но если будут какие то вопросы или пожелания о детализации и переводе, нет проблем, сделаю как только освобожусь в ближайшее время;
—Maksud 05:17, 8 апреля 2010 (UTC)
|
| Обсуждение |
|
| Добавить комментарий |
Спонсоры:
Хостинг:
Maxim ChirkovДобавить, Поддержать, Вебмастеру