Re: Re: Question about "fd" token

From: (
Date: Sat Jun 13 2009 - 06:42:57 PDT

  • Next message: Paul H. Hargrove: "Re: Question about "fd" token"
    Thank you very much for answering my questions with great patience.But I have something more to ask.
    +"When a checkpoint is requested for a process,the BLCR kernel module sends each thread in that process an unblockable signal"
    Yes, I see BLCR do this in the function"cr_trigger_phase1()" & "cr_trigger_phase2()"
    when we execute "cr_trigger_phase1()":
    It's up to tasks in the target task list(proc_req->tasks).if there are phase1 tasks(even only one phase task) in this task list, then only these phase1 tasks are sent the signal "CR_SIGNUM". otherwise all the tasks in this list are sent the signal(becauese all of them are either "phase2" tasks or "no phase" tasks).
    when we execute "cr_trigger_phase2()":
    only "phase2" tasks and "no phase" tasks in the task list were sent the signal.
    I know the phase1 task is spawned when we register thread callback:
    cri_register_thread()->thread_init()->thread_main()->rc = cri_syscall_token(token, CR_OP_HAND_PHASE1, token);
    After the "cri_register_thread()" finishes , we have created a callback thread, this thread do the "CR_OP_HAND_PHASE1" syscall and register a phase1 handler, then blocks in the kernel until a checkpoint occurs.
    Here comes my first question: I guess: 
    there are tasks in the target task list, may be phase1/phase/no phase tasks ,we first find phase1 tasks, if any, ok , you are not planned to be checkpointed, your work is to execute callback functions. so the handler of phase1 tasks do nothing other than execute callback functions. then phase2 and no phase tasks .these tasks are planned to be checkpointed. so invoke cr_checkpoint() or do_checkpoint()  separately. 
    Am I right? If this is right, I want to know why the target task list can contain the callback thread. in which scene?
    my second question: if I am wrong. what are the differences among the no-phase ,phase1, phase2 task? their corresponding signal handler deal with what?
    I see phase1 handler simply changes the state of thread. while phase2 handler invoke cr_checkpoint() to execute callbacks array first...uh.....I am confused...
    my last question is: To the callback threads which are added into the target task list as phase1 task,I know how they are waked up after blocked for checkpoint request.But I don't know ones not added into that list , how are they waked up?

  • Next message: Paul H. Hargrove: "Re: Question about "fd" token"