ORB Descriptors with any other detectors can be used? - feature-detection

Can I use ORB descriptor with any other detectors like AGAST / FREAK instead of ORB detector?
Does it yield in much more efficient results.

Related

Strange disk I/O with Pytorch multi workers!

I am using pytorch to train networks. But I find dataloader is very slow even with multi workers. After some debug I find that the disk I/O is kind of strange.
As you can see,I have many worke with python command,but the reading speed is 0?Only the mount.ntfs command have all the reading speed which is far from the full speed(>120M/s). Why?
Thanks for help!

Is there a simple way to fork a file descriptor?

I've just read a handful of man pages: dup, dup2, fcntl, pread/pwrite, mmap, etc.
Currently I am using mmap, but it's not the nicest thing in the world because I have to manage file offset and buffer length myself and basically reimplement read/write in userspace.
From what I gathered:
dup, dup2, fcntl just create aliases for the fds, so their offsets and flags are shared - reading from one advances the offset of the others.
pread/pwrite can be buggy and give inconsistent results.
mmap is buggy on linux when given some uncommon flags, but I don't need them.
Am I missing something or is mmap really the way to go?
(Note that re-open()ing a file is dangerous on POSIX - unlike Windows, POSIX provides no guarantees on the path not being moved/deleted while the file is open. On POSIX, you can open a path, move the file, and still read from it. You can even delete the file sometimes. I also couldn't find anything that can open an inode.)
I'd like answers for at least the most common POSIX variants, if there's no one answer for them all.
On Linux, opening /proc/self/fd/$NUM will work regardless of whether the file still has the same name it had the first time you opened it, and will generate a new open file description (i.e. a new fd with independent offset and flags).
I don't know of any POSIXly portable way of doing this.
(I also don't know what you mean about pread/pwrite being buggy...)

FUSE: Multiple opens on the same file

Does the OS/VFS/FUSE-layer manage the semantics of multiple handles to the same file, or is that something that the driver has to arbitrate?
Short: If you want to disallow that, you have to handle it in the driver.
Long: I did not find any indication in the POSIX error codes of open() that would prevent having multiple handles for the same file in the same process. Wikipedia states that this is fine:
The same file may be opened simultaneously by several processes, and even by the same process (resulting in several file descriptors for the same file) depending on the file organization and filesystem.
FUSE in it's documentation does not condemn it either; it often just proxies the semantics.
To try it, I opened the same file in Python twice, and got two different file descriptors.
In [1]: fd1 = open("./resting.org")
In [2]: fd2 = open("./resting.org")
In [3]: fd1.fileno()
Out[3]: 5
In [4]: fd2.fileno()
Out[4]: 6
So, you have to prevent it yourself, might stay POSIX compliant, since it's unspecified, but may violate an assumption some unknowing programmer made.

Data-link layer libraries linux kernel

I am implementing a routing protocol. For this to work, I need to know failures at the data-link layer. Are there libraries available irrespective of the underlying data-link layer protocol, which gives me hooks (like netfilter) to capture such information.
Since, this is an experiment on the protocol, I'm trying to find if there is anything that is available so that it can be implemented on the user-space rather than writing a kernel-module for the same.(Since, I'm totally new to kernel programming)
Any heads-up for the same will be really helpful.
Just a guess:
you can view sysfs entries ( suppose you have sysfs configured in your kernel) about your network interface, like:
cat /sys/class/net/eth0/carrier # link carrier status
1
cat /sys/class/net/eth0/operstate # should be also related, but
up # forget about what it means.

How to check if the block is present in a sparse file (for simple copy-on-write)?

How to get sparse block size and check if data is present at the given offset in sparse file in reiserfs/ext3 in Linux?
I want to use it to implement simple copy-on-write block device using FUSE.
Or I should better keep a bitmap in a separate file?
/usr/src/linux/Documentation/filesystems/fiemap.txt
The fiemap ioctl is an efficient method for userspace to get file
extent mappings. Instead of block-by-block mapping (such as bmap), fiemap
returns a list of extents.
There's a quick example of usage in git://kernel.ubuntu.com/cking/debug-code/fiemap/. A sparse file will lack extents for the "missing" portions.
Since Linux 3.1, lseek provides flags SEEK_HOLE and SEEK_DATA to navigate to the beginning or end of a hole, so this might be an alternative to the ioctl based solution. Haven't tried either in practice, so I don't have any real experience to compare the two.
Well, http://lxr.linux.no/#linux+v2.6.33/arch/um/drivers/cow_user.c indicates that User Mode Linux uses an explicit bitmap for this, FWIW.

Resources