The UNIX and Linux Forums  

Go Back   UNIX e Linux Forum > Inizio Forum > Di programmazione ad alto livello
.
google unix.com



Di programmazione ad alto livello Pubblica domande su C, C + +, Java, SQL, e di altri linguaggi di programmazione qui.

Più di UNIX e Linux Forum Argomenti potreste trovare utili
Filo Thread Starter Forum Risposte Ultimo Post
semaforo raguramtgr UNIX for Dummies Domande & Risposte 7 06-15-2009 10:39 AM
Semaphore Jaken Shell scripting e di programmazione 2 04-04-2009 06:10 PM
dmidecode, velocità di RAM \u003d "Velocità attuale: Sconosciuto" Santi Filesystem, memoria e dischi 0 02-16-2006 06:16 AM
Semaphore vjsony UNIX for Dummies Domande & Risposte 3 04-07-2003 03:06 PM
semaforo yls177 UNIX for Dummies Domande & Risposte 1 10-09-2002 12:18 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Cerca in questo Thread Rating: Thread Rating: 1 votes, 4.00 average. Modalità di visualizzazione
  #1 (permalink)  
Old 09-17-2008
migurus migurus is offline
Utente Registrato
  
 

Iscriviti Data: Sep 2008
Posizione: Stati Uniti
Interventi: 49
semaforo velocità di accesso ai

Sono alcune indagini di bloccaggio regime utilizzando i semafori. Per valutare la velocità di base del sistema eseguire un ciclo di ottenere alcune informazioni semaforo e visualizzarla:

mentre:; fare. / semshow; fatto> res.txt

Questo mi sono imbattuto su 3 caselle - due analoghi moderni HP Xeon scatole, eseguendo uno SCO OpenServer 5, l'altro è Fedora 2.6.9, e un vecchio PIII casella sotto Linux moderni (non hanno informazioni).
I risultati sono molto controproducente intuitiva:
H / W | OS | avg numero di piste numero sec
---- | --- | -------------------------
Xeon | SCO | 1700
Xeon | Fedora | 500
PIII | Linux (distribuzione recente, sconosciuto) | 900
Tutti e tre i sistemi sono stati praticamente inattivo a tempo l'esecuzione della prova.

Vorrei chiedere, quali sarebbero i fattori che rende antica Unix a sovraperformare moderni sistemi operativi, inoltre, come mai PIII casella sovraperformare moderna Xeon casella sotto OS simili. Qualsiasi ponters sarebbe apprezzato.

Il programma è molto semshow di base, consultare l'elenco qui di seguito:
Codice:
 
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include  <sys/timeb.h>
#include <time.h>
#include "semlib.h"
#define MODE_CREATE     0
#define MODE_REMOVE     1
key_t   IPCKEY;
main(int argc, char *argv[])
{
  int   sid, i;
  pid_t last_rpid, last_wpid;
  char  dbuf[80];
  union semun           arg;
  unsigned short        vals[NSEMS];
  struct timeb tb;
  struct tm *tp;
        if((IPCKEY = get_ipc_key()) == -1)
        {
                errexit("Can Not Obtain IPC Key");
        }
        if((sid = semget(IPCKEY, NSEMS, 0)) == -1)
        {
                errexit("Can Not Get Semaphore ID");
        }
        memset(vals, 0, sizeof(vals));
        arg.array = &vals[0];
        if(semctl(sid, NSEMS, GETALL, arg) == -1)
        {
                errexit("Can Not Get Semaphore Values");
        }
        if((last_rpid = semctl(sid, RDLOCK, GETPID)) == -1)
        {
                errexit("Can Not Get Semaphore R-Pid");
        }
        if((last_wpid = semctl(sid, WRLOCK, GETPID)) == -1)
        {
                errexit("Can Not Get Semaphore W-Pid");
        }
        ftime(&tb);
        tp = localtime(&tb.time);
        strftime(dbuf, sizeof(dbuf) - 1, "%T", tp);
        printf("%12li.%03i %s  RD:[%i]  WR:[%i] %i/%i\n",
                tb.time, tb.millitm, dbuf, 
                vals[RDLOCK], vals[WRLOCK],
                last_rpid, last_wpid);
        exit(0);
}
semlib.h ha DEFS questi:
Codice:
 
#define NSEMS   2
#define RDLOCK  0
#define WRLOCK  1
union   semun   {
        int             val;
        struct semid_ds *buf;
        unsigned short  *array;
};
 

Segnalibri

Thread Tools Cerca in questo Thread
Cerca in questo Thread:

Ricerca Avanzata
Modalità di visualizzazione Vota questo thread
Vota questo thread:

Distacco regolamento
Tu non può post nuovo thread
Tu non può inviare una risposta
Tu non può postare allegati
Tu non può modificare i tuoi post

BB codice è Su
Smilies sono Su
[IMG] codice Su
Codice HTML è Chiuso
Trackbacks sono Su
Pingbacks sono Su
Refbacks sono Su




Tutti gli orari sono GMT -4. La data di oggi è 09:02 AM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Traduzioni Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
UNIX e Linux Forum Content Copyright © 1993-2009. Tutti i diritti Reserved.Ad di gestione da RedTyger

Contenuti pertinenti URL da vBSEO 3.2.0