ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
* [sisyphus] Ядра 2.4 и 2.6 - в чём различия?
@ 2004-11-26  8:46 Epiphanov Sergei
  0 siblings, 0 replies; only message in thread
From: Epiphanov Sergei @ 2004-11-26  8:46 UTC (permalink / raw)
  To: Рассылка Sisyphus

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

Есть программка (в аттаче). Если её собрать и запустить, получаются 
следующие результаты:

1. ядро 2.4.27-std-up-alt1 и 2.4.27-std-smp-alt1
Execution time=5.99862 seconds

2. ядро 2.6.9-std26-smp-alt11
Execution time=6.09922 seconds

В обоих случаях запускал и под обычным пользователем, и под root с nice=-20 
в runlevel=3 и runlevel=1. Результат практически не меняется. То же самое 
обнаружил и в сложной программе: на ядре 2.6 таймер растягивает время вне 
зависимости от шага таймера (можно поставить и 30мс, и 300мс) и вывода на 
экран. В чём может быть проблема и как её обойти на 2.6 (мне это ядро 
боьше нравится)?

-- 
С уважением, Епифанов Сергей

[-- Attachment #2: testschm.cpp --]
[-- Type: text/x-c++src, Size: 2677 bytes --]

/***************************************************************************
 *   Copyright (C) 2004 by Epiphanov Sergei                                *
 *   serpiph@nikiet.ru                                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/


#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <iostream>
#include <cstdlib>

#include <string.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/ipc.h>
#include <sys/shm.h>

void handler(int i){
    return;
}



using namespace std;

int main(int argc, char *argv[])
{
    //cout << "Hello, world!" << endl;
    struct timeval begin, end;
    struct timezone tz __attribute__ ((__unused__));
    struct sigaction sa;
    memset( &sa, 0, sizeof( sa) );
    sa.sa_handler = handler;
    sigaction( SIGALRM, &sa, NULL );

    struct itimerval tv;
    tv.it_interval.tv_sec = 0;
    tv.it_interval.tv_usec = 60000;
    tv.it_value.tv_sec = 0;
    tv.it_value.tv_usec = 60000;
    setitimer( ITIMER_REAL, &tv, NULL );

    gettimeofday( &begin, &tz);
    for( int i=0; i<100; i++){
        pause();
        cout << "Number=" << i << "\n";
    }
    gettimeofday( &end, &tz);

    cout << "Execution time=" << (end.tv_sec-begin.tv_sec)+ ((float)end.tv_usec-(float)begin.tv_usec)/1e6<< " seconds\n";

    tv.it_interval.tv_usec = 0;
    tv.it_value.tv_usec = 0;
    setitimer( ITIMER_REAL, &tv, NULL );

    sa.sa_handler = SIG_DFL;
    sigaction( SIGALRM, &sa, NULL );

    return EXIT_SUCCESS;
}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-26  8:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-26  8:46 [sisyphus] Ядра 2.4 и 2.6 - в чём различия? Epiphanov Sergei

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sisyphus


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git