Overview
| Artifact ID: | a3312134f23375d11eb68b999f813a12a154cb54 |
|---|---|
| Ticket: | a0bc856dcde485c71fc657fc9387842e41b6449d
Unix: Start notifier thread in Tcl_InitNotifier again if process id changed due to fork1 |
| User & Date: | oehhar on 2013-07-17 15:23:55 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
Rivet, the Apache tcl module, does the following: # Apache starts one process and starts a TCL interpreter # Users have the ability to execute commands now. For the huge FlightAware website, it was written, that loading packages now, instead in step 4, saves 40 minuites of time. # Apache forks this process to worker processes including the initialized TCL interpreter. The Notifier Thread required for <b>fileevent</b> is not present in the new process. # Users have the possibility to do per process initialisation here, like data base open etc. # If a page is requested, an interpreter in a worker process is called. The issue is, that <b>fileevents</b> do not fire any more, as there is only one notifier thread in the first process. The notifier thread is invoked by all processes as the anonymous pipe is still active but has no access to shared memory and file handlers of the forked processes. The idea is to modify the exposed procedure <b>Tcl_InitNotifier</b> to: # Check, if it was forked, e.g. if the process id changed # If so, close the connection to the pipe and start a new notifier thread. Then, <b>Tcl_InitNotifier</b> may be called after the fork and anything is working again... The current version of <b>Tcl_InitNotifier</b> only creates the thread on the very first call and thus does not recreate after the fork. Some web pointers: * [https://groups.google.com/forum/#!topic/comp.lang.tcl/Ja01kv75tVk|clt thread "Async sockets hang under Rivet but work in tclsh 8.6"] * [https://issues.apache.org/bugzilla/show_bug.cgi?id=55153|Rivet Bug 55153 "fileevents do not fire"]
- foundin changed to: "8.6.0"
- is_private changed to: "0"
- login: "oehhar"
- priority changed to: "5 Medium"
- private_contact changed to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "oehhar"
- subsystem changed to: "01. Notifier"
- title changed to:
Unix: Start notifier thread in Tcl_InitNotifier again if process id changed due to fork1
- type changed to: "RFE"