MCPcopy Create free account
hub / github.com/acl-dev/acl / main

Function main

lib_acl_cpp/samples/mem_cache/main.cpp:152–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152int main(int argc, char* argv[])
153{
154 if (0)
155 test1();
156
157 int ch, num = 10, nthread = 1;
158 char addr[256];
159 void (*func)(const char* addr, int id, int num) = NULL;
160
161 snprintf(addr, sizeof(addr), "127.0.0.1:11211");
162
163 while ((ch = getopt(argc, argv, "hl:gsdmn:t:T:")) > 0)
164 {
165 switch (ch)
166 {
167 case 'h':
168 usage(argv[0]);
169 return (0);
170 case 'l':
171 snprintf(addr, sizeof(addr), "%s", optarg);
172 break;
173 case 'g':
174 func = get;
175 break;
176 case 's':
177 func = set;
178 break;
179 case 'm':
180 func = mod;
181 break;
182 case 'd':
183 func = del;
184 break;
185 case 'n':
186 num = atoi(optarg);
187 break;
188 case 't':
189 __timeout = atoi(optarg);
190 break;
191 case 'T':
192 nthread = atoi(optarg);
193 break;
194 default:
195 break;
196 }
197 }
198
199 printf("server: %s\n", addr);
200
201 if (func == NULL)
202 usage(argv[0]);
203 else
204 {
205 if (nthread <= 1)
206 func(addr, 0, num);
207 else
208 {
209 acl_pthread_pool_t* pool = acl_thread_pool_create(nthread, 100);

Callers

nothing calls this directly

Calls 5

acl_thread_pool_createFunction · 0.85
acl_pthread_pool_destroyFunction · 0.85
test1Function · 0.70
usageFunction · 0.70
getoptFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…