Hi,
This makes sense although I'd suggest a specific command to create the
resource with a name at startup. The use would then be similar
to nsdb handles:
at startup:
set fp [open /my/file]
ns_chan create myfile $fp
in a thread:
set fp [ns_chan register myfile]
... use $fp as normal ...
ns_chan unregister myfile $fp
You might want to use the subcommands "get" and "put" instead of
"register" and "unregister" to clarify the thread is getting exclusive access to the
resource. Also, timeout support could be convienent, e.g.:
if ![ns_chan register myfile 200 fp] {
... handle timeout after 200ms ...
}
... use channel set in $fp ...
Finally, consider the deadlock detection code in nsdb as well although
that may be going to far -- a note in the docs to always get channels in the
same order should suffice.
-Jim
In a message dated 7/5/2003 2:11:31 PM Eastern Daylight Time,
[EMAIL PROTECTED] writes:
On Saturday 05 July 2003 17:21, you wrote:
|
- Re: [AOLSERVER] Tcl shared channels Jean-Fabrice RABAUTE
- Re: [AOLSERVER] Tcl shared channels Jean-Fabrice RABAUTE
- Re: [AOLSERVER] Tcl shared channels Zoran Vasiljevic
- Re: [AOLSERVER] Tcl shared channels Jean-Fabrice RABAUTE
- Re: [AOLSERVER] Tcl shared channels Jean-Fabrice RABAUTE
- Re: [AOLSERVER] Tcl shared channels Zoran Vasiljevic
- Re: [AOLSERVER] Tcl shared chan... Jean-Fabrice RABAUTE
- Re: [AOLSERVER] Tcl shared chan... Zoran Vasiljevic
- Re: [AOLSERVER] Tcl shared channels Jim Davidson
- Re: [AOLSERVER] Tcl shared channels Zoran Vasiljevic
- Re: [AOLSERVER] Tcl shared channels Jim Davidson
- Re: [AOLSERVER] Tcl shared channels Jean-Fabrice RABAUTE
- Re: [AOLSERVER] Tcl shared channels Zoran Vasiljevic
- Re: [AOLSERVER] Tcl shared channels Zoran Vasiljevic
- Re: [AOLSERVER] Tcl shared channels Jean-Fabrice RABAUTE
- Re: [AOLSERVER] Tcl shared channels Zoran Vasiljevic
- Re: [AOLSERVER] Tcl shared channels Jeff Hobbs
- Re: [AOLSERVER] Tcl shared channels Zoran Vasiljevic