Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost API System or Library Calls ..
From: Niall Douglas (s_sourceforge_at_[hidden])
Date: 2013-11-06 16:55:46


On 6 Nov 2013 at 20:51, Rahul Mathur wrote:

> AFAIK system call is how a program requests a service from an OS kernel
> (viz. it's an interface between user-level code and the kernel), but the
> call to the library function itself does not cause a switch to kernel mode.
>
> Also, AFAIK usages of too many system calls normally may result into high
> number of CONTEXT SWITCHES so thought to ask before using any calls.

There are also two kinds of syscall, fast (vdso) and slow. The fast
kind doesn't context switch.

Recent editions of both Windows and Linux implement fast syscalls (I
think FreeBSD always has?). Which syscalls are fast and which are
slow is entirely implementation dependent, and using Boost is a bad
way of being that close to the metal.

If you really need to worry about context switches, you shouldn't be
using Boost and probably not even C++. Use a hard realtime OS like
QNX, and write everything in C or assembler.

Niall

-- 
Currently unemployed and looking for work.
Work Portfolio: http://careers.stackoverflow.com/nialldouglas/



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net