epoll
by Peter Bortas @ Pike developers forum
07 Sep '06
07 Sep '06
It's an implementation detail if epoll syscall comes with a device of
not, so is there some special reason the configure test checks for
/dev/epoll? I'm currently forceing it to epoll in machine.h to get it
to build on Debian stable.
I'm working on an Objective-C bridge for Pike, and I've got a problem
as it relates to threads that I'd like to get some input on. My
module wraps Objective-C objects within Pike objects and the other
way around. The problem I'm running into is when I try to create
threads in Objective-C. I create the thread successfully (using
NSThread). The new thread is supposed to run some c code that
eventually finds a Pike function to run, pushes its arguments onto
the stack, then calls the function with those arguments. When running
in Hilfe, everything seems to work fine until I call apply_svalue().
At that point, Pike dies:
> .NSClass("NSThread")->detachNewThreadSelector_toTarget_withObject_
("run", dummythreadrunner(), .NSClass("NSString")->stringWithCString
("foo"));
Whee! We're wrappin' an object, thread=-1610559648
PiObjCObject.methodSignatureForSelector: run
(1) Result: 0
> PiObjCObject.forwardInvocation: run
pushed args, thread=25755136
C stack overflow.
src/modules/files/file.c:3913: Fd(0)->read
(Public.ObjectiveC.dummythreadrunner()->run,"C stack overflow.\n")
/usr/local/pike/7.6.86/lib/modules/Stdio.pmod/module.pmod:109:
Stdio.File("stdin", "r", 777 /* fd=0 */)->read()
/usr/local/pike/7.6.86/lib/modules/Stdio.pmod/Readline.pike:568:
Stdio.Readline()->InputController()->run_blocking()
/usr/local/pike/7.6.86/lib/modules/Stdio.pmod/Readline.pike:1603:
Stdio.Readline()->edit("",UNDEFINED,UNDEFINED)
/usr/local/pike/7.6.86/lib/modules/Tools.pmod/Hilfe.pmod:2258:
Tools.Hilfe.StdinHilfe()->create(UNDEFINED)
/usr/local/pike/7.6.86/lib/modules/Tools.pmod/Hilfe.pmod:0:
Tools.Hilfe->StdinHilfe()
As you can see, the thread is created, and code is running in the new
thread. I've not released the thread lock in my code (it bails out
either way), and until assign_svalue is called, all of the other
calls to internal c-pike functions work successfully (see
forwardInvocation PiObjCObject.m in CVS). Any suggestions about how
I can solve this problem?
source is available here:
http://buoy.riverweb.com:8080/viewrep/cvs/pike_modules/Public_ObjectiveC
Bill