Boost API System or Library Calls ..
Out of curiosity, wish to know if BOOST ASIO calls like - boost::asio::read() boost::asio::transfer_all() boost::asio::write() BOOST LEXICAL calls like - boost::lexical_caststd::string() BOOST POSIX TIME calls like - boost::posix_time::microsec_clock::universal_time() boost::posix_time::microsec_clock::ptime() are LIBRARY or SYSTEM calls. How to know which calls of BOOST are SYSTEM and LIBRARY calls? Thanks.
Out of curiosity, wish to know if BOOST ASIO calls like -
boost::asio::read() boost::asio::transfer_all() boost::asio::write()
BOOST LEXICAL calls like - boost::lexical_caststd::string()
BOOST POSIX TIME calls like - boost::posix_time::microsec_clock::universal_time() boost::posix_time::microsec_clock::ptime()
are LIBRARY or SYSTEM calls.
How to know which calls of BOOST are SYSTEM and LIBRARY calls?
Not sure what you mean by "system" and "library" (note that a Boost function can rely on some CRT facility, which in turn might call OS API), but you always can step into a desired function and see how it's implemented.
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.
On Wed, Nov 6, 2013 at 7:23 PM, Igor R
Out of curiosity, wish to know if BOOST ASIO calls like -
boost::asio::read() boost::asio::transfer_all() boost::asio::write()
BOOST LEXICAL calls like - boost::lexical_caststd::string()
BOOST POSIX TIME calls like - boost::posix_time::microsec_clock::universal_time() boost::posix_time::microsec_clock::ptime()
are LIBRARY or SYSTEM calls.
How to know which calls of BOOST are SYSTEM and LIBRARY calls?
Not sure what you mean by "system" and "library" (note that a Boost function can rely on some CRT facility, which in turn might call OS API), but you always can step into a desired function and see how it's implemented. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On 11/6/2013 10:21 AM, 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.
Almost all libraries depend to some extent on operating system calls to manage resources, in particular to manage memory. It is not realistic to program based on whether a library calls the operating system for some reason. If you end up programming that way you end up contorting design to something that is harder to write, understand, or change. I do not think such contortions are worth it in any way.
On Wed, Nov 6, 2013 at 7:23 PM, Igor R
mailto:boost.lists@gmail.com> wrote: > Out of curiosity, wish to know if BOOST ASIO calls like - > > boost::asio::read() > boost::asio::transfer_all() > boost::asio::write() > > BOOST LEXICAL calls like - > boost::lexical_caststd::string() > > BOOST POSIX TIME calls like - > boost::posix_time::microsec_clock::universal_time() > boost::posix_time::microsec_clock::ptime() > > are LIBRARY or SYSTEM calls. > > How to know which calls of BOOST are SYSTEM and LIBRARY calls?
Not sure what you mean by "system" and "library" (note that a Boost function can rely on some CRT facility, which in turn might call OS API), but you always can step into a desired function and see how it's implemented. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org mailto:Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
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/
On 11/06/2013 06:23 AM, Rahul Mathur wrote:
How to know which calls of BOOST are SYSTEM and LIBRARY calls?
Let me quote from the POSIX standard (chapter A.3) ''The distinction between a "system call" and a "library routine" is an implementation detail that may differ between implementations and has thus been excluded from POSIX.1'' Boost is build on top of POSIX, so if POSIX cannot tell, then there is no way that Boost can.
participants (5)
-
Bjorn Reese
-
Edward Diener
-
Igor R
-
Niall Douglas
-
Rahul Mathur