[lkml]   [2005]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [patch 1/2] fork_connector: add a fork connector
    Guillaume Thouvenin wrote:
    > On Mon, 2005-03-21 at 12:52 -0800, Ram wrote:
    >> If a bunch of applications are listening for fork events,
    >> your patch allows any application to turn off the
    >> fork event notification? Is this the right behavior?
    > Yes it is. The main management is done by application so, if several
    > applications are listening for fork events you need to choose which one
    > will turn off the fork connector.

    It is not practical. One listener never know who else are listening
    to the fork connector.

    We also need to protect yet another global variable "cn_fork_enable".

    Also, in order to implement "cn_fork_enable" as a counter, we need
    some sort of registration to prevent an application from sending
    repeated "off" notification. One can only turn off its own switch.

    - jay

    > I want to keep this turn on/off mechanism simple but if it's needed I
    > can manage the variable "cn_fork_enable" as a counter. Thus the callback
    > could be something like:
    > static void cn_fork_callback(void *data)
    > {
    > int start;
    > struct cn_msg *msg = (struct cn_msg *)data;
    > if (cn_already_initialized && (msg->len == sizeof(cn_fork_enable))) {
    > memcpy(&start, msg->data, sizeof(cn_fork_enable));
    > if (start)
    > cn_fork_enable++;
    > else
    > cn_fork_enable > 0 ? cn_fork_enable-- : 0;
    > }
    > }
    > What do you think about this implementation?
    > Guillaume

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-04-06 13:30    [W:0.021 / U:25.060 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site