|
From: Ø. H. <oyv...@zy...> - 2008-09-09 08:12:11
|
On Tue, Sep 9, 2008 at 3:17 AM, Duane Ellis <op...@du...> wrote: > Øyvind Harboe wrote: > >> - Having given it some thought, I would like to make it the C code's >> responsibility to invoke keep_alive and target_call_timer_callbacks_now() >> Is there any >> reason we can't do this? Really in a perfect world(or ultimately >> w/OpenOCD), >> keep_alive & target_call_timer_callbacks_now() would go away. I've also >> formulated a patch that makes keep_alive() invokoe >> target_call_tiemr_callbacks_now(). >> > > What C code? Where? > > Which C functions should and should not invoke "keep alive"? > > How do we decide _this_one_ needs it - and _that_one_ does not? If keep_alive() wasn't a kludge there would be a clear answer to that. keep_alive() *is* a global kludge and the best we can hope to do, I think is *not* to expose it to Tcl. > And - do we start renaming functions so that they describe their complete > function by tacking "_and_calls_keep_alive" on the function name? keep_alive() is in lieu of preemptive multithreading, so we don't need to rename functions, we can/should just call keep_alive() from anywhere we find out we need it. Note that this is pretty much all handled at this point, i.e. we're calling keep_alive() often enough that the GDB protocol does not break down. > As we discussed - the goal was - to translate the target_process_reset() > into TCL - and periodically - something in the TCL may have to 'help a > little bit' > > Today - we have no idea what somebody might need to do in an event proc, or > during the reset process. OpenOCD is opensource so we *can* change the source, i.e. expand the source code to accomodate some unforseen future need. If we mess up the API it will be much harder to change, even if OpenOCD is open source. > Today - openocd does not use "pthreads()" and I don't want to even go near > that. > > Thus - "keep_alive" might well be an evil we must live with :-( Yup! Note that we *are* already calling keep_alive() pretty much everywhere we need to and a BUG: is logged when it doesn't happen often enough. I consider the keep_alive() >90% solved at this point and we don't need to reach 100%. -- Øyvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 XScale Cortex JTAG debugger and flash programmer |