Linux ¶àÏ̱߳à³Ì
linux ¶àÏ̱߳à³Ì·Ç³£¼òµ¥¡£
Ò»¡¢¶àÏ̱߳à³ÌµÄÁ÷³Ì£º
´´½¨Ïß³Ì--->µ±Ç°Ï̼߳ÌÐø¹¤×÷--->£ÛÓë´´½¨µÄÏß³Ìͬ²½£Ý--->£ÛµÈ´ý´´½¨µÄÏ߳̽áÊøÓë·µ»Ø£Ý--->µ±Ç°Ï̼߳ÌÐø¹¤×÷¡£
--->´´½¨µÄÏ߳̿ªÊ¼¹¤×÷--->£ÛÓë±ðµÄÏß³Ìͬ²½£Ý--->Í˳öÏ̲߳¢·µ»Ø
Ïß³ÌÓõöÖ÷ÒªµÄº¯Êý¡£
1.Ï̴߳´½¨º¯Êý£ºpthread_create(pthread_t * id,pthread_attr_t *attr,void *(*start_routine)(void*),void *arg);
id---Ïß³Ìid ,Ï̴߳´½¨³É¹¦Ê±µÄ·µ»ØÖµ£¬ÓÃÓÚ¶ÔÏ̵߳IJÙ×÷¡£
attr---Ïß³ÌÊôÐÔ£¬¼òµ¥µÄÉèΪNULL¾Í¿ÉÒÔÁË¡£
void *(*start_routine)(void*) --- Ï̺߳¯Êý£¬Ò²¾Í¹¤×÷Ï̵߳Äʵ¼ÊÔËÐв¿·ÖµÄ´úÂë¶Î¡£
arg --- Ï̲߳ÎÊý£¬ÊÇË«ÏòµÄ£¬Ò²¾ÍÊÇÒ»¸öÊäÈëÊä³öÀàÐ͵IJÎÊý¡£
2.µÈ´ýÏ̷߳µ»Øº¯Êý£ºpthread_join(pthread_t id,void *ret);
id--- Ïß³Ìid¡£
ret --- Ï̵߳ķµ»ØÖµ¡£
3.Í˳öỊ̈߳ºpthread_exit(void *ret);
ret --- Ï̷߳µ»ØÖµ¡£
Ò»¸ö¼òµ¥µÄÏ̵߳ÄÀý×Ó£º
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <pthread.h>
void *thread_function(void *arg);
char message[] = "Hello World";
int main() {
int res;
pthread_t a_thread;
void *thread_result;
res = pthread_create(&a_thread, NULL, thread_function, (void *)message);
if (res != 0) {
perror("Thread creation failed");
exit(EXIT_FAILURE);
}
printf("Waiting for thread to finish...\n");
res = pthread_join(a_thread, &thread_result);
if (res != 0) {
perror("Thread join failed");
exit(EXIT_FAILURE);
}
printf("Thread joined, it returned %s\n", (char *)thr
Ïà¹ØÎĵµ£º
±¸Óá£
Ö»ÓÐÏàͬÓû§²ÅÄÜʵÏÖÉ豸µÄͬʱ´ò¿ª¡£
pcm.!dmix {
type dmix
ipc_key 5678293
ipc_key_add_uid yes
slave {
pcm "hw:0,0"
period_time 0
period_size 2048
buffer_size 16384
format S16_LE
rate 48000
}
}
pcm.!dsnoop {
type dsnoop
ipc_key 5778293
ipc_key_add_uid yes
slave {
pcm "hw:0 ......
ÓÉÓÚLINUX
CûÓжÔ×Ö·û´®×Ó´®Ìæ»»¹¦ÄÜ,ËùÒÔÎÒ×Ô¼ºÐ´ÁËÒ»¸östr_replaceº¯Êý,ʵÏÖÁË×Ö·û´®Ìæ»».
Çë´ó¼Ò²Î¿¼.
/*
* FUNCTION : str_replace
*
ABSTRACT : replace child string in a string.
*
PARAMETER &nbs ......
aria2ÊÇÎÒ½ñÌìÐÂѧµ½µÄÒ»¸öÃüÁîÐеÄÏÂÔØ¹¤¾ß£¬ËäÈ»»¹Ã»Ñо¿Í¸£¬µ«ÊÇËû¾ø¶Ô±Èwget¸üºÃ.
aria2 ÊÇ Linux ÏÂÒ»¸ö²»´íµÄ¸ßËÙÏÂÔØ¹¤¾ß
¡£ÓÉÓÚËü¾ßÓзֶÎÏÂÔØÒýÇæ£¬ËùÒÔÖ§³Ö´Ó¶à¸öµØÖ·»òÕß´ÓÒ»¸öµØÖ·µÄ¶à¸öÁ¬½ÓÀ´ÏÂÔØÍ¬Ò»¸öÎļþ¡£ÕâÑù×ÔÈ»¾Í´ó´ó¼Ó¿ìÁËÎļþµÄÏÂÔØËÙ ¶È¡£aria2 Ò²¾ßÓжϵãÐø´«¹¦ÄÜ£¬ÕâʹÄãËæÊ±Äܹ»»Ö¸´ÒѾÖÐ¶Ï ......
dd if=/dev/zero of=/dev/rd/1 bs=1k count=9216
mke2fs -vm0 /dev/rd/1 9216
mount /dev/rd/1 /tmp/
umount -v /tmp
ÒÔÏÂÊÇ×ªÔØ×Ôhttp://www.cublog.cn/u1/59740/showart_472783.html
linux RamDisk
ʹÓüò½é
1
¡¢
Ram Disk
½éÉÜ
1.1
ʲôÊÇRam Disk
Ram Disk
¾ÍÊǽ«ÄÚ´æÖеÄÒ»¿éÇøÓò× ......