linuxÏ̵߳ÄÓÅÏȼ¶ÉèÖÃ
linux²¢²»ÊÇʵʱ²Ù×÷ϵͳ£¬°ÑÏÂÃæµÄ´úÂëÔËÐÐÒ»±é¾ÍÄܹ»Àí½âÁË£¬´úÂëÓкÜÏêϸµÄ×¢ÊÍ¡£
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <signal.h>
#include <string.h>
void * thr_fun(void *arg)
{
int policy, ret;
struct sched_param param;
//»ñÈ¡Ï̵߳÷¶È²ÎÊý
ret = pthread_getschedparam(pthread_self(), &policy, ¶m);
if(ret!=0)
{
printf("pthread_getschedparam %s\n", strerror(ret) );
exit(1);
}
if (policy == SCHED_FIFO)
{
printf("policy:SCHED_FIFO\n");
}
else if (policy == SCHED_OTHER)
{
printf("policy:SCHED_OTHER\n");
}
else if (policy == SCHED_RR)
{
printf("policy:SCHED_RR\n");
}
printf("param:%d\n", param.sched_priority);
long long i;
while (1) {
i++;
i *= 2;
}
pthread_exit(NULL);
}
int main(void)
{
int ret;
pthread_t tid;
pthread_attr_t attr;
int policy, inher;
struct sched_param param;
//³õʼ»¯Ïß³ÌÊôÐÔ
pthread_attr_init(&attr);
//»ñÈ¡¼Ì³ÐµÄµ÷¶È²ßÂÔ
ret = pthread_attr_getinheritsched(&attr, &inher);
if (ret!=0)
{
printf("pthread_attr_getinheritsched\n%s\n", strerror(ret));
exit(1);
}
//
if (inher == PTHREAD_EXPLICIT_SCHED)
{
printf("PTHREAD_EXPLICIT_SCHED\n");
}
else if (inher == PTHREAD_INHERIT_SCHED)
{
printf("PTHREAD_INHERIT_SCHED\n");
inher = PTHREAD_EXPLICIT_SCHED;
}
//ÉèÖü̳еĵ÷¶È²ßÂÔ
//±ØÐèÉèÖÃinherµÄÊôÐÔΪ PTHREAD_EXPLICIT_SCHED£¬·ñÔòÉèÖÃÏ̵߳ÄÓÅÏȼ¶»á±»ºöÂÔ
ret = pthread_attr_setinheritsched(&attr, inher);
if (ret!=0)
{
printf("pthread_attr_setinheritsched\n%s\n", strerror(ret));
exit(1);
}
policy = SCHED_FIFO;//ÔÚUbuntu9.10ÉÏÐèÒªrootȨÏÞ
//ÉèÖÃÏ̵߳÷¶È²ßÂÔ
ret = pthread_attr_setschedpolicy(&attr, policy);
if (ret!=0)
{
printf(" pthread_attr_setschedpolicy\n%s\n", strerror(ret));
exit(1);
}
param.sched_priority = 3;
//ÉèÖõ÷¶È²ÎÊý
ret = pthread_attr_setschedparam(&attr,
Ïà¹ØÎĵµ£º
´´½¨×ÀÃæÍ¼±ê
Ŀǰ½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËÆµÄ·½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......
linuxÏÂoracleµÄ×Ô¶¯±¸·Ý
http://hohai2002.blog.163.com/blog/static/1628166912010323103227543/
±¸·Ý
ÉÏ´«root_cronµ½rootĿ¼
ʹÓÃcrontab ÅäÖÃÎļþ
crontab -u root /root/root_cron
ʹÓÃcrontab -l ¼ì²é
#Îļþ root_cron
01 00 * * * /etc/root_exp.sh
#Îļþroot_exp.sh
su - oracle -c /oracle/db ......
which Óï·¨ which command ˵Ã÷ ÒÀÐò´Ópath»·¾³±äÁ¿ËùÁеÄĿ¼ÖÐÕÒ³öcommandµÄλÖ㬲¢ÏÔʾÍêÕû·¾¶µÄÃû³Æ¡£ÔÚÕÒµ½µÚÒ»¸ö·ûºÏÌõ¼þµÄ³ÌÐòÎļþʱ£¬¾ÍÁ¢¿ÌÍ£Ö¹ËÑË÷£¬Ê¡ÂÔÆäÓàδËÑË÷Ŀ¼¡£ ·¶Àý£¬ÕÒ³ölsÃüÁîµÄ³ÌÐòÎļþµÄλÖ㺠which ls ϵͳÊä³ö£º /usr/bin/ls whereis Óï·¨ whereis [option] name ˵Ã÷ ÕÒ³öÌØ¶¨ ......
½ñÌìµÄÊÂÌ«¶à£¬Ã»ÓÐÈÏÕæµÄÍê³ÉÈÎÎñ£¬²»¹ý°Ñ·þÎñÆ÷¶ËµÄÎļþ´«Êä×öºÃÁË£¡
Ã÷Ìì°Ñ·þÎñÆ÷¶ËµÄ´úÂ뼯³ÉÆðÀ´²âÊÔһϣ¬²¢°ÑÍøÂç¿Í»§¶Ë³ÌÐò×öºÃ£¡
°Ñ´úÂëÌù³öÀ´°É£¡±ãÓÚ±£´æ£¡
Í·Îļþ£ºserver_udpsocket.h
#ifndef _SERVER_UDPSOCKET_H_
#define _SERVER_UDPSOCKET_H_
#include <stdio.h>
#include <stdlib.h>
......
±¾ÎÄת×Ô http://zhzhiqun2005.javaeye.com/blog/462799
Linuxϰ²×°ÅäÖà Jdk1.6+Tomcat6+Apache2.2.x+jk_mod1.2 Ïê½â
Linuxϰ²×°ÅäÖà Jdk1.6+Tomcat6+Apache2.2.x+jk_mod1.2 Ïê½â
±¾ÆªÒÔRedhat AS5£¬ÄÚºËΪLinux 2.6.18-8.el5 ΪÀý£¬ÆäÖÐRedhat/FedoraϵÁлù±¾Ò»Ö£¬ÆäËûLinux»òÕß° ......