You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i want create a thread in HHVM extension but failed.
code as follows:
59 int stacksize = 1048576;
60 int guardsize = 4096;
61
62 pthread_t thread1;
63 void *thread_result;
64 pthread_attr_t attr;
65 int res_init = pthread_attr_init(&attr);
66 int res_detach = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
67 int res_sstack = pthread_attr_setstacksize(&attr, stacksize);
68 int res_sguard = pthread_attr_setguardsize(&attr, guardsize);
69 int res = pthread_create(&thread1, &attr, pfunc, NULL);
70 sleep(1);
71 pthread_join(thread1, &thread_result)
However, create failed and core dumped in pthread_create.
we just to adjust pthread_attr_t attr,
if we set attr = NULL, work ok!!!!
if we set attr.stacksize=1MB, work failed!!!!!.
if we set attr.stacksize=2B, work ok!!!!
Is there anything different in HHVM to create a thread using libpthread?? this errors strongly confused me for 3 weeks. And we just read HHVM code involved MemoryManager and some functions involved Initing some params of thread, such as hphp_process_init(), init_thread_locals(), InitAllocatorThreadLocal(), init_stringdata_allocator(). But we couldnot fix this problem. is there anybody to give us some useful idea??
Thanks.
The text was updated successfully, but these errors were encountered:
Summary: [Fix an upstream bug](mozilla/cbindgen#1006) and [add ability to put arbitrary prefix on field names](mozilla/cbindgen#1007).
Reviewed By: jasonwhite
Differential Revision: D63878067
fbshipit-source-id: 16a35ed1fa2adc4c9211fc6f6332f0be7dbf4f56
code as follows:
59 int stacksize = 1048576;
60 int guardsize = 4096;
61
62 pthread_t thread1;
63 void *thread_result;
64 pthread_attr_t attr;
65 int res_init = pthread_attr_init(&attr);
66 int res_detach = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
67 int res_sstack = pthread_attr_setstacksize(&attr, stacksize);
68 int res_sguard = pthread_attr_setguardsize(&attr, guardsize);
69 int res = pthread_create(&thread1, &attr, pfunc, NULL);
70 sleep(1);
71 pthread_join(thread1, &thread_result)
However, create failed and core dumped in pthread_create.
if we set attr = NULL, work ok!!!!
if we set attr.stacksize=1MB, work failed!!!!!.
if we set attr.stacksize=2B, work ok!!!!
Is there anything different in HHVM to create a thread using libpthread?? this errors strongly confused me for 3 weeks. And we just read HHVM code involved MemoryManager and some functions involved Initing some params of thread, such as hphp_process_init(), init_thread_locals(), InitAllocatorThreadLocal(), init_stringdata_allocator(). But we couldnot fix this problem. is there anybody to give us some useful idea??
Thanks.
The text was updated successfully, but these errors were encountered: