Mercurial
comparison seobeo/os/s_linux_edge.c @ 65:ecb6ee6a22c3
[Misc] I will no longer drink cool aids of capital P.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Wed, 24 Dec 2025 06:22:59 -0800 |
| parents | ea9ef388ab97 |
| children | a0f0ad5e42eb |
comparison
equal
deleted
inserted
replaced
| 64:a30944e5719e | 65:ecb6ee6a22c3 |
|---|---|
| 68 } | 68 } |
| 69 | 69 |
| 70 void Seobeo_Web_Edge( | 70 void Seobeo_Web_Edge( |
| 71 Seobeo_PHandle p_server_handle, | 71 Seobeo_PHandle p_server_handle, |
| 72 int thread_count, | 72 int thread_count, |
| 73 Dowa_PHashMap p_html_cache) | 73 Dowa_HashMap *p_html_cache) |
| 74 { | 74 { |
| 75 pthread_attr_t attr; | 75 pthread_attr_t attr; |
| 76 pthread_attr_init(&attr); | 76 pthread_attr_init(&attr); |
| 77 pthread_attr_setstacksize(&attr, 5 * 1024 * 1024); // 5 MB | 77 pthread_attr_setstacksize(&attr, 5 * 1024 * 1024); // 5 MB |
| 78 | 78 |
| 91 | 91 |
| 92 pthread_attr_destroy(&attr); | 92 pthread_attr_destroy(&attr); |
| 93 } | 93 } |
| 94 | 94 |
| 95 | 95 |
| 96 void Seobeo_Web_Edge_2(Seobeo_PHandle p_handle_server, Dowa_PHashMap cache) | 96 void Seobeo_Web_Edge_2(Seobeo_PHandle p_handle_server, Dowa_HashMap *cache) |
| 97 { | 97 { |
| 98 const int MAX_EVENTS = 1024; | 98 const int MAX_EVENTS = 1024; |
| 99 struct epoll_event events[MAX_EVENTS]; | 99 struct epoll_event events[MAX_EVENTS]; |
| 100 char keybuf[32]; | 100 char keybuf[32]; |
| 101 | 101 |
| 115 perror("epoll_ctl ADD server"); | 115 perror("epoll_ctl ADD server"); |
| 116 close(epfd); | 116 close(epfd); |
| 117 return; | 117 return; |
| 118 } | 118 } |
| 119 | 119 |
| 120 Dowa_PHashMap handles = Dowa_HashMap_Create(1024); | 120 Dowa_HashMap *handles = Dowa_HashMap_Create(1024); |
| 121 snprintf(keybuf, sizeof(keybuf), "%d", p_handle_server->socket); | 121 snprintf(keybuf, sizeof(keybuf), "%d", p_handle_server->socket); |
| 122 Dowa_HashMap_Push_Value(handles, keybuf, p_handle_server, sizeof(p_handle_server)); | 122 Dowa_HashMap_Push_Value(handles, keybuf, p_handle_server, sizeof(p_handle_server)); |
| 123 | 123 |
| 124 while (1) { | 124 while (1) { |
| 125 int n = epoll_wait(epfd, events, MAX_EVENTS, -1); | 125 int n = epoll_wait(epfd, events, MAX_EVENTS, -1); |