Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Replace select/poll with kqueue/kevent Post 80663 by Perderabo on Wednesday 10th of August 2005 01:14:40 PM
Old 08-10-2005
I had never heard of kqueue/kevent. Poking around I found this pdf document. It looks like a very nice piece of work. I wish it was in all versions of unix. But it looks like it is currently in BSD only. Too bad.

We are not really a realtime os group. But your question "I m wondering whether kqueue/kevent is same as the real-time OS event model." seem to imply that there is a single model for real time OS's. Poking around again I found a couple that were different from each other and did not look "the same" as kqueue. The general notion of an event channel seems to be pretty common though.

I'm going to pass on the api question. Unix is sort of a family of very similiar operating systems. That's rare, perhaps unique. I don't believe that there is similiar family of real-time os's that would enable the writing of very portable applications via a unified api. But I'm not an expert in that area and I could be wrong.
 

8 More Discussions You Might Find Interesting

1. Programming

How to convert the "select" function into a "poll" function

i have a program using the select function but i want to convert it to poll... how can i do this? thanks in advance... :) (1 Reply)
Discussion started by: rbolante
1 Replies

2. Programming

select/poll and Signal Safety

Hi I am struggling to understand why one should use pselect()/ppoll() instead of wrapping an ordinary select() or poll() call around sigprocmask(). The linux man page talks about “race conditions”, but how would such dangers occur? I plan to use poll() for an application (since ppoll() isn't... (0 Replies)
Discussion started by: nopcoder
0 Replies

3. IP Networking

select vs poll

Hi, Off late I had been looking at the differences b/w select() & poll() system calls. The requirement is to reduce the overhead, processor power in waiting for the data. In the kind of connections under consideration there would be very frequent data arriving on the sockets, so poll() fares... (12 Replies)
Discussion started by: smanu
12 Replies

4. Shell Programming and Scripting

how to poll for new files?

Hi , i have a requirement in which i have to ftp files to unix from windows and vice versa. I have to encrypt files in windows which will then be decrypted in unix and vice versa. Now the process needs to be automated ..therefore when windows server or unix server recieves the files a shell... (5 Replies)
Discussion started by: lifzgud
5 Replies

5. Shell Programming and Scripting

How to use poll() for I/O multiplex

Hi, guys: I want to write my own shell using C. I am confused about the usage of I/O multiplex. Does anyone know some examples or explain it to me ? Thanks so much (1 Reply)
Discussion started by: tomlee
1 Replies

6. UNIX for Dummies Questions & Answers

select and replace only those string which is followed by \tab

Hi I have a number of sequences and a string occurs a number of times in that sequence. How can I select and replace only those strings which are followed by \tab. for eg : my sequence looks like : string0 positive cd parent=string0 id =121 string0 string0 negative ef parent=... (2 Replies)
Discussion started by: sonia102
2 Replies

7. Programming

[Solved] SQL SELECT REPLACE

Hi All, I had a query related to sql select update replace command. i have a table named clusters and it looks like this name model characteristics sample1.1 +123 parent sample1.2 -456 clone sample1.3 +122 ... (5 Replies)
Discussion started by: sonia102
5 Replies

8. Programming

Sql select replace

Hi All, I had a query related to sql select replace command. i have a table named clusters and it looks like this Code: name characteristics sample 1.1 parent sample 1.2 ... (2 Replies)
Discussion started by: siya@
2 Replies
KFILTER_REGISTER(9)					   BSD Kernel Developer's Manual				       KFILTER_REGISTER(9)

NAME
kfilter_register, kfilter_unregister -- add or remove kernel event filters SYNOPSIS
#include <sys/event.h> int kfilter_register(const char *name, struct filterops *filtops, int *retfilter); int kfilter_unregister(const char *name); DESCRIPTION
The kfilter_register() function adds a new kernel event filter (kfilter) to the system, for use by callers of kqueue(2) and kevent(2). name is the name of the new filter (which must not already exist), and filtops is a pointer to a filterops structure which describes the filter operations. Both name and filtops will be copied to an internal data structure, and a new filter number will be allocated. If retfilter is not NULL, then the new filter number will be returned in the address pointed at by retfilter. The kfilter_unregister() function removes a kfilter named name that was previously registered with kfilter_register(). If a filter with the same name is later reregistered with kfilter_register(), it will get a different filter number (i.e., filter numbers are not recycled). It is not possible to unregister the system filters (i.e., those that start with ``EVFILT_'' and are documented in kqueue(2)). The filterops structure is defined as follows: struct filterops { int f_isfd; /* true if ident == filedescriptor */ int (*f_attach)(struct knote *kn); /* called when knote is ADDed */ void (*f_detach)(struct knote *kn); /* called when knote is DELETEd */ int (*f_event)(struct knote *kn, long hint); /* called when event is triggered */ }; If the filter operation is for a file descriptor, f_isfd should be non-zero, otherwise it should be zero. This controls where the kqueue(2) system stores the knotes for an object. RETURN VALUES
kfilter_register() returns 0 on success, EINVAL if there's an invalid argument, or EEXIST if the filter already exists, kfilter_unregister() returns 0 on success, EINVAL if there's an invalid argument, or ENOENT if the filter doesn't exist. SEE ALSO
kqueue(2), free(9), knote(9), malloc(9) HISTORY
The kfilter_register() and kfilter_unregister() functions first appeared in NetBSD 2.0. AUTHORS
The kfilter_register() and kfilter_unregister() functions were implemented by Luke Mewburn <lukem@NetBSD.org>. BSD
October 23, 2002 BSD
All times are GMT -4. The time now is 10:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy