Tuesday, June 28, 2005

Select - timeout

Linux
The select function may update the timeout parameter to indicate how much time was left. The pselect function does not change this parameter.

Solaris
Select does not update the timeout

But it is good practice to set timeout everytime before calling "select"

Usages of select

Select system call prototype -
int select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);

where
Four macros are provided to manipulate the sets.
FD_ZERO will clear a set.
FD_SET and FD_CLR add or remove a given descriptor from a set.
FD_ISSET tests to see if a descriptor is part of the set;

" n is the highest-numbered descriptor in any of the three sets, plus 1."
timeout is an upper bound on the amount of time elapsed before select returns. It may be zero, causing select to return immediately. (This is useful for polling.)
If timeout is NULL (no timeout), select can block indefinitely.

So always try to use "n" as (highest_fd+1) -> it will definately improve performance as seen by us on OpenVMS

Wednesday, June 08, 2005

ACPI and APM

There are two types of power managenet: APM and ACPI
APM is older than ACPI .... my toshiba(A75-S206 BIOS) supports ACPI.

ACPI(Advanced Configuration and Power Interface) ::
"(ACPI) An open industry standarddeveloped by Intel, Microsoft, and Toshiba for configuration and power management."

I am still quite new to this but , what I want is a applet which uses ACPI. I am Gnome user which is having a applet uses APM not ACPI. I don't know if it has applet which is using ACPI.

KDE has "Klaptop_check" which uses ACPI , which is quite good. I don't know how I start loving Gnome.