xml파일 자바파일 package com.example.a25thread; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.TextView; public class MainActivity extends AppCompatActivity { private Thread thread; private TextView textView; private TextView textView1; private int number = 0; private int num = 10000; @Override protec..
#include #include #include #include #define NUM_THREAD 100 void * thread_inc(void * arg); void * thread_des(void * arg); long long num = 0; int main(int argc, char *argv[]) { pthread_t thread_id[NUM_THREAD]; int i; printf("sizeof long long: %d\n", sizeof(long long)); for(i = 0; i
TCP-IP 소켓통신 THREAD CHAPTER3 #include #include #include #include void* thread_main(void *arg); int main(int argc, char *argv[]) { pthread_t t_id; int thread_param = 5; void *thr_ret; if(pthread_create(&t_id, NULL, thread_main, (void*)&thread_param)!=0) { puts("pthread_create() error"); return -1; }; if(pthread_join(t_id, &thr_ret)!=0) { puts("pthread_join() error"); return -1; }; printf("Thread r..
TCP-IP 소켓통신 THREAD CHAPTER2 #include #include #include #include void* thread_main(void *arg); int main(int argc, char *argv[]) { pthread_t t_id; int thread_param = 5; void * thr_ret; if(pthread_create(&t_id, NULL, thread_main, (void*)&thread_param)!=0) { puts("pthread_create() error"); return -1; }; if(pthread_join(t_id, &thr_ret)!=0) { puts("pthread_join() error"); return -1; }; printf("Thread ..
TCP-IP 소켓통신 THREAD CHAPTER1 #include #include void* thread_main(void *arg); int main(int argc, char *argv[]) { pthread_t t_id; int thread_param=5; if(pthread_create(&t_id, NULL, thread_main, (void*)&thread_param)!=0) { puts("pthread_create() error"); return -1; }; sleep(10); puts("end of main"); return 0; } void* thread_main(void *arg) { int i; int cnt=*((int*)arg); for(i=0; i