[okl4-developer] restart server thread

aparna das aparna006 at gmail.com
Wed Jan 13 17:12:31 EST 2010


Hi,

I have created a dummy server that just prints some statements. In the main
function of the server I delete the server thread as follows:
int main(int argc, char *argv[]) {
    pd_ref_t pd;
    dummypd = pd_myself();

    printf("***************************************\n");
    printf("dummy server\n");
    printf("***************************************\n");


    thread_delete_self();
    printf("deleted\n");

    vdummy_server_loop();
    assert(!"Should reach here");
    return 0;
    (void)iguana_granted_physmem;
    (void)iguana_granted_interrupt;
    (void)virtual_device_instance;
}
My elf weaver file for the dummy server looks as follows:
<program name="vdummy" file="/home/aparna/okl4_2.1/build/iguana/bin/vdummy"
priority="110" server="OKL4_DUMMY_SERVER" >
        <virt_device name="vdummy0" />
        <environment>
            <entry key="DUMMY_RESOURCE" cap="/dev/dummy_dev" />
        </environment>
 </program>
Upto this point when I execute I can ensure using KDB that the vdummy thread
is deleted.
I have provision that on pressing Ctrl-P, the serial server restarts the
dummy thread.
My code in serial that handles it is as follows:

    memsection_ref_t ms;
    iguana_dummytid = pd_create_thread(117920,&l4_dummytid);
    ms = env_memsection(iguana_getenv("OKL4_DUMMY_SERVER"));
    memsection_register_server(ms,iguana_dummytid);
    thread_start(iguana_dummytid,0x500000,(335728));

where I know the value of pd_ref_t of dummy is 117920 (from pd_myself), the
start address of dummy is 0x500000 and the sp.
However when I execute it, it does without any problem but I cannot find the
new dummy thread in schedule queue or any print statements.

Please help.

Thanks
Aparna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20100113/b064659c/attachment.htm 


More information about the Developer mailing list