For Programmers: Free Programming Magazines  


Home > Archive > Tcl > March 2004 > TIP #178: [info pid] and [info tid] subcommands









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author TIP #178: [info pid] and [info tid] subcommands
Joe Mistachkin

2004-03-27, 12:27 am


TIP #178: [INFO PID] AND [INFO TID] SUBCOMMANDS
========================================
=========
Version: $Revision: 1.1 $
Author: Joe Mistachkin <joe_at_mistachkin.com>
State: Draft
Type: Project
Tcl-Version: 8.5
Vote: Pending
Created: Sunday, 21 March 2004
URL: http://purl.org/tcl/tip/178.html
WebEdit: http://purl.org/tcl/tip/edit/178
Post-History:

-------------------------------------------------------------------------

ABSTRACT
==========

This TIP proposes two new [info] subcommands which are used to obtain
the current process and thread identifiers.

RATIONALE
===========

In certain types of applications, it is important to know what thread
is currently executing. This is especially true for multithreaded
applications or for scripts running in a threaded build of Tcl.

While the author realizes that there is already a [pid] command, the
addition of the [info pid] subcommand still makes sense for the
following reasons:

* The [pid] command can also provide information totally unrelated
to the /current/ process identifier. At one point ([TIP #88]) it
was even suggested that the [pid] command be overloaded to
provide process control related functionality.

* To allow scripts that dynamically build other scripts
(potentially for use with safe interpreters) using the [info]
command and caller provided arguments. Using the [info] command
instead of the [pid] command limits the amount of information
that can be obtained by the safe interpreter.

PROPOSED CHANGE
=================

Two new subcommands, [info pid] and [info tid], would be added to the
[info] command with the following syntax:

*info pid*

This subcommand would return the process identifier for the current
process.

*info tid*

This subcommand would return the thread identifier for the current
thread.

DRAFT IMPLMENTATION
=====================

A complete implementation of this TIP is availble at:


<URL:http://sf.net/tracker/?func=detail&...894&atid=310894>

COPYRIGHT
===========

This document has been placed in the public domain.

-------------------------------------------------------------------------

TIP AutoGenerator - written by Donal K. Fellows

[[Send Tcl/Tk announcements to tcl-announce@mitchell.org
Announcements archived at http://groups.yahoo.com/group/tcl_announce/
Send administrivia to tcl-announce-request@mitchell.org
Tcl/Tk at http://tcl.tk/ ]]

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com