473,225 Members | 1,264 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,225 software developers and data experts.

system function

bob
Which is faster - a call to a system function or a call to a library
function?

Apr 11 '06 #1
8 3170
bo*@coolgroups.com wrote:
Which is faster - a call to a system function or a call to a library
function?


Which functions? Which library? Which system? Your question is too
vague to be meaningful.

Cheers! --M

Apr 11 '06 #2
<bo*@coolgroups.com> wrote:
Which is faster - a call to a system function or a call to a library
function?


If you really have to know, do a hundred million or so of each and measure
the time.
Apr 11 '06 #3
bob
This is what they asked me in an interview. what do you think they
were getting at?

Apr 11 '06 #4
bo*@coolgroups.com wrote:
This is what they asked me in an interview. what do you think they
were getting at?


Perhaps they were trying to get you to tell them the question was too
vague to be meaningful. If you picked either choice they offered you,
they'd know you didn't know what you were talking about.

Cheers! --M

Apr 11 '06 #5
bo*@coolgroups.com wrote:
Which is faster - a call to a system function or a call to a library
function?
and
This is what they asked me in an interview. what do you think they
were getting at?


Probably the expected answer had something to do with this:

If the program environment is a "normal" operating system, a library
function call is a straightforward call executed in the context of the
calling process. As a minimum, the internal overhead consists of
transferring the function parameters and saving the return address.

A system function call, on the other hand, may use some kind of trap
instruction, it may produce a switch to kernel/supervisor mode, may
require saving/restoring process information, etc., a much larger
overhead.

This refers to the time required to do the call/invocation only, with
no reference to the time required to execute the function.

That's why in many systems it is faster to read a file using, for
example, a 16K buffer, than reading it one byte at a time.
It reduces the number of read system calls and their overhead.

Apr 11 '06 #6
Roberto Waltman wrote:
bo*@coolgroups.com wrote:
Which is faster - a call to a system function or a call to a library
function?


and
This is what they asked me in an interview. what do you think they
were getting at?


Probably the expected answer had something to do with this:

If the program environment is a "normal" operating system, a library
function call is a straightforward call executed in the context of the
calling process. As a minimum, the internal overhead consists of
transferring the function parameters and saving the return address.

A system function call, on the other hand, may use some kind of trap
instruction, it may produce a switch to kernel/supervisor mode, may
require saving/restoring process information, etc., a much larger
overhead.

This refers to the time required to do the call/invocation only, with
no reference to the time required to execute the function.

That's why in many systems it is faster to read a file using, for
example, a 16K buffer, than reading it one byte at a time.
It reduces the number of read system calls and their overhead.


But still, the question is too vague as posed. The "library function"
in question may well call one or more of these trapped "system
functions". We really don't have enough information to answer the
question properly.

Cheers! --M

Apr 11 '06 #7
"mlimber" <ml*****@gmail.com> wrote:
But still, the question is too vague as posed. The "library function"
in question may well call one or more of these trapped "system
functions". We really don't have enough information to answer the
question properly.


Agreed - That's why I wrote "*Probably* the *expected* answer had
something to do with ..."

(Any woman would immediately sense the lack of commitment... ;) )

Apr 11 '06 #8
bo*@coolgroups.com wrote:
This is what they asked me in an interview. what do you think they
were getting at?


If they actually expected any answer other than "You'd have to measure to be
sure. Anything else would be complete speculation that could easily be
wrong." then you're better off not working for them anyway.

--
Reginald Blue
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my
telephone."
- Bjarne Stroustrup (originator of C++) [quoted at the 2003
International Conference on Intelligent User Interfaces]
Apr 11 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: monkey king | last post by:
I have a given dll file(PDFCreator.dll) - probably generated by VC++. I want to use its method(PDFCreator()) in dotNet environment. It works well in WindiowsApplication, but bad in WebApplication...
2
by: Phil Stanton | last post by:
When designing a new form or report, the Default ForeColor is often something like -2147483640 which is the colour of Windows text (possibly black) and the default backColor is -2147483643...
36
by: AussieRules | last post by:
Hi, I want to use the user color scheme to set the color of my forms. I now I have to use the. System.Drawing.SystemColors, but which color is the color of a form background as used in other...
5
by: Lance | last post by:
I want to expose properties of a class to a user via a PropertyGrid class. Some of the properties are of type System.IO.FileInfo. Ideally, an OpenFileDialog window would appear when the user...
6
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
14
by: prasadjoshi124 | last post by:
Hi All, I am writing a small tool which is supposed to fill the filesystem to a specified percent. For, that I need to read how much the file system is full in percent, like the output given...
9
by: Xah Lee | last post by:
REQUIREMENTS FOR A VISUALIZATION SOFTWARE SYSTEM FOR 2010 Xah Lee, 2007-03-16 In this essay, i give a list of requirements that i think is necessary for a software system for creating...
22
by: schneider | last post by:
I need to hook the system mouse down event. I'm trying to replicate how a context menu hides when the mouse clicks outside of the control. Thanks, Schneider
7
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I am using this code to get groups for a user and getting a error (5) on the GetAuthorizationGroups() function . There are two domains. This function works on the local domain but does not work...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.