Process Timers in Linux Operating System

Clocks and timers have been a part of UNIX systems from their very inception. Standard UNIX (POSIX.1) has three clocks. One tells the time and is directly accessible to the user. The other two have other purposes, which don’t often concern the application programmer. There are 2 types of timers: one shot timers and repeating ones. The former only expires once and is used to signal a special event that needs to occur only once. Repeating timers go off at regular intervals and are used to schedule periodic events.

There is, basically, only one clock which application programs use in Linux. The operating system keeps track of current date and time by storing the number of seconds that have elapsed since, midnight January 1, 1970 UTC. This period is also called an epoch. This date is considered as the informal -birthday’ of the UNIX operating system. The time is stored in a signed long integer. The time function can be used to know how much time in seconds has elapsed since the start of the epoch. The prototype for time call is: #include time_t time (time_t) *tloc);

In all versions of UNIX the time() system call may be used to obtain the time of the day. This call is peculiar in that if given the address of a long integer as an argument, it places the time in that integer and returns it. If, however, a null pointer is passed, the time of day is just returned. The time_t is convenient for calculating differences between times, but difficult to print dates. Several routines are available to convert the long integer returned by time() into an ASCII date string. With the UNIX operating system, an ASCII date string is a string as shown below: Day Mon dd hh: mm : ss yyyy

The ctime() library function can be used to do the above conversion. Its prototype is:

#include Char *ctime (const time_t *clock) Example: #include #include Int main () { long now, time (); struct tm *today, *localtime (); time ( today=localtime ( printf (-today is: %d/%d/%d \n-, today->tm_mon + 1, today->tm_mday, today->tm_year); exit(0); }

This time function measures real time or wall clock time. In a multiprogramming environment, we may be more interested in the amount of time an individual process uses. This is called virtual time. The system call tiems returns information about the execution times of a process and its children. One shot timers: the most common example of these kind of timers would be the sleep call. #include Unsigned sleep(unsigned seconds);

When a process executes sleep it blocks for the number of seconds specified. The sleep function can be used as a sort of crude interval timer. Standard UNIX timers: the standard UNIX interval timers defined in the Berkeley and SR4(1170) versions of UNIX are as follows – ITIMER_REAL ITIMER_VIRTUAL ITIMER_PROF

POSIX Interval timers: the 1170 specification timers do not provide sufficient flexibility to deal with real time tasks. To be useful in real-time environments, we need more than just three timers. There needs to a greater time resolution and allowance for determining timer overruns.

All in all, UNIX timers can be used to find out the CPU time requirements of a program for benchmarking. Interval timers are also extremely important to allow scheduled tasking.

To know more, click here

Linux And Windows Are The Best Hosting Plans Being Offered By Hosting Providers

The incursion of industries has initiated the rise of websites that are being opened everyday. However, getting the right web hosting provider in India to help you host your website can be a frightening task. Luckily, Linux hosting can be assumed for the purpose of hosting and this is perhaps the best hosting option available, and it can surely deliver all your needs and demands.

Web Hosting providers in India are amongst the best hosting providers throughout the world, offering its customers complete access on a particular server. Service providers in India are one of the cheapest, and they offer high-quality services. They also do take full management of the site as you use it. A dedicated team of professionals who respond to the call of clients and are always prepared to handle any kind of situation. The other thing that sets a company apart from others is the fact that, they should offer you the best guaranteed service from the time you contact them to work on your website. Furthermore, they should include all the features you are looking for on your website. The best products that web hosting provider have today are the Linux hosting, Windows hosting and some affordable hosting plans.

Linux hosting plans offer a company to build their websites using the Linux Operating System. The advantage of this is that it is more flexible and offers the best open source technology that includes PHP, MySQL, Python and XML. This Linux hosting system is an example of an open source UNIX operating system. The other advantage of best web hosting provider in India is that it offers more power than other regular plans can.

Furthermore, the Linux web hosting plan is a much more affordable web hosting platform that many people are currently using. The ability of this plan to do web hosting at such cheap prices has made it possible for best web hosting providers to provide much wider space to their plans, which gives you features that are much faster to work with. The best things to look out for when hiring such a plan is to look for its value in terms of money, its quality and the plans’ ability to be relied on.

However, the windows hosting comes in three packages, a windows start, windows professional as well as windows unlimited. All these packages have certain distinct features. The best features it has a hosting control panel for all the packages, unlimited email accounts as well as no set up charges. In addition, if you are not satisfied with the web hosting plan, you can get your money back in 30 days. Many companies have many personal and individual plans for their customers.

The best plan to choose when looking for an affordable hosting provider is first you should know the size of your website and also how many emails you expect to get in a year. Furthermore, you also should know roughly how many people are likely to visit your website in a month or so. These features can help you in selecting the best for your company.