Skip to content
Tcl Source Code History Of Ticket 659131ffff
Login

History Of Ticket 659131ffff

Artifacts Associated With Ticket 659131ffff

  1. Ticket change [16dc450ec0] (rid 124782) by elfring on 2002-12-27 20:19:09:

    1. assignee initialized to: "vasiljevic"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I want to continue our communication 
      (https://sourceforge.net/tracker/?group_id=10894&atid=360894&func=detail&aid=577014) 
      because the "Thread package 
      2.5" is available. The package has 
      been improved in severall ways.
      
      1. It seems that some things 
      that are offered by the pthreads library can still be done in the 
      future.
      - add missing lock types 
      (http://www.humanfactor.com/pthreads/pthread-code-
      snippets.html)
      
      2. more "convenience" functions for thread 
      shared variables
      "string", "regexp" or "keyed list" from the TclX 
      extension for example
      
      3. Will a thread that was not preserved 
      ("thread::create" without option "-preserved") exit 
      immediately?
      
      4. A sub function "names" is available for some 
      commands. I think that it would be needed for "thread::mutex" and 
      "thread::cond", too.
      
      5. When will it be possible to query the 
      mutexes and condition variables by which threads they are 
      used?
      
      6. The description for "thread::vwait" is missing. 
      (http://cvs.sourceforge.net/cgi-
      bin/viewcvs.cgi/*checkout*/tcl/thread/doc/html/thread.html)
      
      7. 
      The function "tsv::lock" is available. How do you think about a similar 
      function "thread::lock"?
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "elfring"
    9. subsystem initialized to: "80. Thread Package"
    10. title initialized to: "development targets: Complete pthreads?"
    11. type initialized to: "RFE"
  2. Ticket change [20763f8f87] (rid 91313) by elfring on 2002-12-28 04:10:32:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1. Another POSIX item
      - semaphores (Comparing Primitives - 
      http://docs.sun.com/db/doc/806-
      6867/6jfpgdcn0?l=de&a=view)
      Will this be offered, too?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  3. Ticket change [0161312e60] (rid 119473) by elfring on 2002-12-28 20:13:25:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      8. Is the technique "sending TCL scripts" the only inter-thread 
      communication mechanism with the thread package?
      Will "message 
      ports" (http://www.gnu.org/software/pth/pth-manual.html#message port 
      communication) be applicable?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  4. Ticket change [9d4bbfb463] (rid 96280) by elfring on 2002-12-28 20:33:42:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      9. Is there anything to be careful about forking a new 
      process?
      (http://www.gnu.org/software/pth/pth-
      manual.html#process forking)
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  5. Ticket change [10f93d6f98] (rid 95063) by elfring on 2002-12-28 20:57:38:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      10. Can the explanation for "spurious thread wake-ups" with the function 
      "thread::cond wait" become more comprehensible?
      (Interrupted 
      Waits on Condition Variables - http://docs.sun.com/db/doc/806-
      6867/6jfpgdcn9?a=view)
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  6. Ticket change [73f31cf278] (rid 105121) by vasiljevic on 2002-12-28 21:06:47:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      1.  
      Semaphores are ok. So are critical sections and recursive 
      locks. But, what I want to achieve is *simplicity*. Thread 
      programming has become pretty simple thanks to the Tcl 
      compartment thread model. If you look at the tpool.tcl source 
      you won't find a single condition variable or a mutex. Yet, 
      relatively complex implementation of threadpool is done with 
      Tcl alone and it is only about 20% slower than the C-level 
      implementation. Furthermore, the Tcl implementation costed 
      about 2 days development. The C-one took 10 days. So, 
      economically speaking, the Tcl version is the clear winner. 
       
      Needles to say that a semaphore can be done in pure Tcl 
      with a mutex and a condition variable, which the threading 
      extension already supplies.  
       
      2. I will include the keyed-list datastructure in 2.6. 
       
      3. It will just have the refcount of 0 meaning that caller of 
      such "non-preserved" thread may never know wether the 
      thread is still there for the next operation. But, it will not  
      exit w/o being told so with a "thread::release" 
       
      4. I will shortly revamp the cond/mutex Tcl API support. Watch 
      for the new TIP. This way the API will be more powerful and  
      you can get many new info/statistics about the mutex etc. 
       
      5. Inherently impossible by pthread alone. 
       
      6. There is no such command in the thread package. There 
      is however thread::wait and it is described. 
       
      7. There is already thread::eval which evaluates a script under 
      the mutex, either implicit or explicit one. 
         
      8. I think that the message passing, together with channel 
      transfer and detach/attach allows one to implement almost 
      any task.  
       
      9. As a script programmer, you can safely do the "exec"  
      from the MT Tcl shell. The underlying implementation will 
      do the right thing. 
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  7. Ticket change [6c40341af0] (rid 128468) by elfring on 2002-12-29 00:25:27:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1. I know that all things that are not provided by the package yet can be done by 
      own additional programming.
      But I read the available documentation in 
      this way that "semaphores" do more (They can be shared between threads 
      and processes.) and are a synchronization technique with other uses than 
      mutex and condition variables alone. The following items are also part of the 
      POSIX standard 1003.1c and may be offered in a future version of the thread 
      package.
      It is good that the thread pool functions were implemented 
      without locking.
      1.1 mutexattr... - http://docs.sun.com/db/doc/806-
      6867/6jfpgdcmn?a=view
      1.2 mutex_consistent_np, mutex_trylock - 
      http://docs.sun.com/db/doc/806-6867/6jfpgdcmo?a=view
      1.3 
      condattr... - http://docs.sun.com/db/doc/806-
      6867/6jfpgdcmp?a=view
      1.4 cond_wait (I assume that the function 
      "pthread_cond_timedwait" is used by the package.), 
      cond_reltimedwait_np - http://docs.sun.com/db/doc/806-
      6867/6jfpgdcmq?a=view
      1.5 sem_... - 
      http://docs.sun.com/db/doc/806-6867/6jfpgdcmr?a=view
      1.6 
      rwlockattr... - http://docs.sun.com/db/doc/806-
      6867/6jfpgdcms?a=view
      1.7 rwlock... - 
      http://docs.sun.com/db/doc/806-6867/6jfpgdcmt?a=view
      
      2. 
      great
      
      3. Will you add this explanation to the 
      documentation?
      
      5. Do you know a function library that will help to get 
      that information?
      
      6. In which package is the call "vwait 
      forever"?
      (You called it "this little bastard" once.)
      
      7. Okay - 
      Evaluation in a locked mode...
      
      8. What you you mean with "message 
      passing"?
      
      9. Well, then your implemenation does not need any 
      special treatment in this case like other threading libraries.
      
      10. Your 
      answer...?
      
      
      Thanks
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  8. Ticket change [c99b428c82] (rid 122316) by elfring on 2002-12-29 00:39:24:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1.8 attr_... - http://docs.sun.com/db/doc/806-6867/6jfpgdcmi?a=view
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  9. Ticket change [3da76aa3de] (rid 121123) by elfring on 2002-12-29 01:06:31:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      9. It is good that the TCL behaviour for the function "exec" is different from that 
      what can be read under "http://docs.sun.com/db/doc/806-
      6867/6jfpgdcn4?a=view".
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  10. Ticket change [b6217f760a] (rid 125372) by vasiljevic on 2002-12-29 01:29:12:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      1. Basicaly, the threading extension exposes the Tcl API.  
      It does *not* add to the API.  
      Speaking of the API, there are some API corners that need  
      to be improved and I'm working on that. There will be a  
      new TIP on this soon.  
      Yes, all the stuff you've described are ok, but do you  
      really need them on the script level? I think I might 
      wrap the rwlocks, although I'm not really convinced that 
      they are a good thing to use.  
       
      3. Sure. 
       
      5. You'd need to make your own wrappers arround  
      pthread_mutex and friends and provide a kind of 
      debugging mutex implementation where you track  
      who (which thread) is holding the mutex and be  
      able to kill the process on deadlock attempts. 
      I might be proposing this in the upcomming TIP. 
      The pthread does not do this for you, but you 
      can make one yourself. 
       
      6. Nowhere. It is an idiom one uses frequently  
      when entering the event loop forever, like in 
      some server applications, for example. 
       
      8. Message passing == script passing. It is basically 
      the same thing. 
       
      10. Ok, the doc is little bit terse on that. I might  
      get put it more clear. 
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  11. Ticket change [ea50714cdb] (rid 103348) by elfring on 2002-12-29 05:40:56:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1. Interesting...
      You mentioned "pthreads". - So I made suggestions in 
      this direction.
      I did not know that the programming interface should 
      improve on the C level before further enhancements can be made. I would 
      prefer that all functionality of the underlying thread function or class library 
      will be also provided on the TCL level.
      The functions that you are not 
      convinced to exist because they are needed. The frequency for their usage 
      patterns is different, of course.
      
      5. I'm curious about that. Please put 
      the ideas into the TIP.
      
      6. I would prefer an other wording than "vwait". 
      Would a "waiting on a thread variable" be easier to understand?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  12. Ticket change [b96c28e3dd] (rid 129139) by elfring on 2002-12-31 04:14:34:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1. I add some links to helpful information about algorithms and 
      technologies.
      1.1 Can the API be improved so that an implementation of 
      the CORBA standard "Concurrency Service" 
      (http://www.omg.org/technology/documents/corbaservices_spec_catalog.htm, 
      http://fpx.de/Combat/) would be possible with TCL?
      1.2 Can the 
      package profit from "Communicating Sequential Processes" 
      (http://www.cs.ukc.ac.uk/research/groups/crg/research_interests.html)
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  13. Ticket change [0236940a98] (rid 119606) by elfring on 2003-01-04 19:33:34:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      I point to another good description:
      Guide to the POSIX Threads Library - 
      http://www.tru64unix.compaq.com/docs/base_doc/DOCUMENTATION/V51_HTML/ARH9RBTE/TITLE.HTM
      
      newsgroup: 
      comp.programming.threads
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  14. Ticket change [6eb3f7c798] (rid 100191) by elfring on 2003-01-05 17:47:52:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Is cooperative multitasking (like "http://www.gnu.org/software/pth/pth-
      manual.html#the compromise of pth") or preemptive multithreading 
      provided by the internal TCL threads library?
      Does this library support 
      simultanous execution on several processors?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  15. Ticket change [303003576c] (rid 93205) by elfring on 2003-01-08 18:08:25:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Are the comments from the discussion "library proposal" 
      (http://groups.google.com/groups?selm=IhBS9.18%
      24LJ1.422974%40news.cpqcorp.net) also applicable to the 
      threads package?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  16. Ticket change [048ae4bfbc] (rid 120012) by elfring on 2003-01-13 00:12:18:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Can anything from the class library "Jsync - collection of synchronization 
      classes for Java" (http://www.garret.ru/~knizhnik/jsync-1.03/package-
      jsync.html) be used for the TIP?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  17. Ticket change [d42d7d80c0] (rid 123407) by elfring on 2003-01-13 01:00:58:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Normative 
      documentation:
      http://www.opengroup.org/onlinepubs/007904975/basedefs/pthread.h.html
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  18. Ticket change [6dc0b525e4] (rid 128754) by vasiljevic on 2003-05-30 23:44:35:

    1. closedate changed to: "2003-05-30T16:44:35"
    2. closer changed to: "vasiljevic"
    3. icomment:
      Logged In: YES 
      user_id=95086
      
      We'll soon make a TIP in order to get more of pthreads available 
      on the C-API so everybody can take advantage of that. 
       
      
      
    4. login: "vasiljevic"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "vasiljevic"
  19. Ticket change [700f74c95c] (rid 100414) by elfring on 2003-08-16 16:43:52:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      It needs some time to get the function interface 
      "http://www.tcl.tk/man/tcl8.4/TclLib/Thread.htm" up to date ...
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  20. Ticket change [3b8b64593e] (rid 112765) by elfring on 2003-08-23 20:31:02:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      When will this Tcl Improvement Proposal (http://www.tcl.tk/cgi-
      bin/tct/tip/2.html) be started?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. status changed to: "Pending"
    5. username: "elfring"
  21. Ticket change [3fb38f3d55] (rid 121511) by vasiljevic on 2003-08-23 21:56:19:

    1. closedate changed to: "2003-08-23T14:56:19"
    2. closer changed to: "vasiljevic"
    3. icomment:
      Logged In: YES 
      user_id=95086
      
      To submit the TIP one needs to have a reference implementation, 
      otherwise nothing will happen. 
      I had very little time to catch up with that so it just keeps  
      sleeping. Hopefully, times will get better. 
       
      
      
    4. login: "vasiljevic"
    5. mimetype: "text/plain"
    6. username: "vasiljevic"
  22. Ticket change [f40fc15a44] (rid 129829) by dkf on 2003-08-24 22:28:38:

    1. closedate changed to: "2003-08-24T15:28:38"
    2. closer changed to: "dkf"
    3. icomment:
      Logged In: YES 
      user_id=79902
      
      Not strictly true, and certainly not to submit it (getting a
      vote to accept is slightly different; we've had problems in
      the past with TIPs where the author hasn't been able to
      arrange implementation effort.) TIPs do require a commitment
      of time and effort from *someone* though, as our engineering
      standards are rather high.
      
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. username: "dkf"
  23. Ticket change [d308505cf2] (rid 113624) by vasiljevic on 2003-08-24 22:42:47:

    1. closedate changed to: "2003-08-24T15:42:47"
    2. closer changed to: "vasiljevic"
    3. icomment:
      Logged In: YES 
      user_id=95086
      
      I know. Chances of getting the TIP accepted are much  
      higher if there is a ref implementation sitting somewhere. 
      In this case, I have very little concern about adoption  
      of the TIP. It is the implementation which troubles me. 
      Not because of the complexity (it is just adding new  
      pthreads C-wrappers here and there) but because of  
      the lack of time. 
      So, lets see if I'll be able to manage that :) 
       
      
      
    4. login: "vasiljevic"
    5. mimetype: "text/plain"
    6. username: "vasiljevic"
  24. Ticket change [d424ecbeff] (rid 123401) by elfring on 2003-08-25 17:58:50:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1. Can we start with an informational TIP?
         It will be transformed to a 
      project TIP later.
      
      2. Have you got wrapper templates or 
      classes?
         Can an example show how easy the missing functions can 
      be added?
      
      3. Would a little "advertisment" help to get more 
      developers to copy and write the code?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "elfring"
  25. Ticket change [a4cab149b0] (rid 110263) by vasiljevic on 2003-08-26 22:33:26:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      1. As far as I'm concerned, everybody is welcome to submit the 
      whatever kind of TIP he/she likes. It is open source development, 
      so anybody is more than welcome to contribute.  
       
      2. I do not have any work done in that direction yet. I wanted to get 
      Tcl thread API to the point that we can shred the AOLserver's 
      custom pthread wrapper, but I'm very short on time lately. 
       
      3. Everybody would benefit from some marketing :) 
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  26. Add attachment "tclPosixThread.zip" [d7f68253ca] (rid 107357) by elfring on 2003-11-05 06:06:27.

  27. Ticket change [4a8eb738b7] (rid 126554) by elfring on 2003-11-05 06:06:27:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1. I reorganized the source code for the files "tclUnixThrd.h" and "tclUnixThrd.c" of TCL 8.4.4 to get a better understanding.
      I refactored the code into separate files. I added a few functions. Can my approch help in our discussion?
      
      2. Does it fit to the expected coding style?
      
      3. How do you think that attributes should be added to the library?
      
      4. I am looking for documentation of the function "TclRememberMutex". - How is the data allocated?
      
      5. I am unsure about the statement "All of these synchronization objects are self initializing." (http://tcl.tk/man/tcl8.4/TclLib/Thread.htm).
      
      6. Should error values be forwared to the variable "errno"?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  28. Ticket change [1185da7762] (rid 95159) by elfring on 2003-11-05 06:06:28:

    1. icomment:
      
      
      File Added - 66487: tclPosixThread.zip
      
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  29. Ticket change [b237fa2eef] (rid 98296) by vasiljevic on 2003-11-06 17:11:16:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      Thank you for your efforts.  
      I will look at the code you've posted. 
      Upfront just a couple of anwers: 
       
      TclRememberMutex is defined in generic/tclThread.c 
      and is just a wrapper for RememberSyncObject. 
       
      Self-initialization of thread sync primitives means 
      there is no explicit creator function. The primitive 
      is auto-initialized on the first use. However, you 
      need to do Tcl_MutexFinalize and/or Tcl_ConditionFinalize 
      when not needed any more. Take care: this can be tricky. 
       
      Tcl_Mutex mutex; 
      Tcl_MutexLock(&mutex); /* will create the mutex */ 
      /*....*/ 
      Tcl_MutexUnlock(&mutex); 
      Tcl_MutexFinalize(&mutex); /* will destroy it */ 
       
      Errors from system calls should be set using  
      Tcl_SetErrno(errno).  
       
       
       
       
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  30. Ticket change [96adf2c7bc] (rid 106366) by elfring on 2003-11-18 02:38:55:

    1. icomment:
      
      
      File Added - 67784: tclPosixThread2.zip
      
      Logged In: YES 
      user_id=572001
      
      7. I reorganized the source code to use inlined functions. (See also "https://sourceforge.net/tracker/?func=detail&aid=838147&group_id=10894&atid=360894".)
      Is the switch "INLINE_SUPPORTED" okay? Or must it replaced by the condition "defined(HAVE_C_INLINE) || defined(__cplusplus)"?
      I'm curious if you can agree with this suggestion.
      
      8. I added the missing attributes and synchronization primitives.
      
      9. I leave out the function "pthread_rwlock_timed(rd|wr)lock" at the moment because I assume that you want the time calculations like it is done in the function "Tcl_ConditionWait".
      
      10. files "tclPosixAttr.h" and "tclPosixSync.h":
      10.1 I am unsure if the "MASTER_LOCK" will be needed by the code.
      10.2 Do the generated names fit to your guidelines?
      
      11. file "generic/tclThread.c":
      11.1 Are you going to add the functions "TclRememberSpin" and "TclRememberRWLock"?
      Or can the function "RememberSyncObject" directly be called?
      11.2 Will any more empty functions be added?
      11.3 What will happen with the "stub table"?
      
      12. Please answer some "TO DO" questions in the code.
      
      13. How are the chances now to get anybody to create a TIP if this is still needed?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  31. Add attachment "tclPosixThread2.zip" [15b390433d] (rid 124610) by elfring on 2003-11-18 02:38:55.

  32. Ticket change [e6f1b036a7] (rid 104375) by vasiljevic on 2003-11-18 03:49:02:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      sorry but I can't unzip the uploaded file. 
      Somehow it tells me I need zip version 2.0 
      or something. I don't have this on my 
      Suse 9.0 system. Can you pack the files with 
      plain tar ? 
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  33. Ticket change [bbbb4f3458] (rid 129539) by elfring on 2003-11-19 05:26:00:

    1. icomment:
      
      
      File Added - 67927: tclPosixThread3.tar.gz
      
      Logged In: YES 
      user_id=572001
      
      another file package...
      
      14. Should be more macros used?
      Examples:
      - EXTERN
      - VOID
      - CONST
      - _ANSI_ARGS_
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  34. Add attachment "tclPosixThread3.tar.gz" [f63ef43a44] (rid 130270) by elfring on 2003-11-19 05:26:00.

  35. Ticket change [2e2864cfd7] (rid 119174) by vasiljevic on 2003-11-19 14:31:21:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      Thanks. Now we're getting somewhere... 
      I did skip thru the distro and there, immediately, 
      one *big* question pops-up which you might be able 
      to answer. 
       
      What it the purpose of your proposal? 
       
      Currently, Tcl offers (incomplete) but practicaly 
      very usable set of API calls to build just about 
      any MT-app you can think of, by *using* Posix pthreads 
      library on Unix. On Windows, it uses native Windows 
      threads library. What can be better than that? 
       
      There are some *dusty* corners about what Posix  
      and/or Win API's offer which are of no great 
      practical use (I never needed the spin mutex 
      in my life, for example). Although I think we 
      should eventually close these holes, the  
      implementation is good as it is.  
      I have compiled a wish-list some time ago, mostly 
      based on AOLserver thread compatibility library 
      about features missing in the Tcl API. This should 
      be the base for the improvement which I wanted to  
      TIP, but never got the time to make the reference 
      implementation. I might send you this if I find it 
      somewhere on my home computer. 
      The idea was to junk the AOLserver thread lib in  
      favour of Tcl API. One this has been done, Tcl  
      would have the most complete, useful and thoroughly 
      tested API not found in any other script environment.  
       
      So, again, what *exactly* is what are you trying 
      to achieve? I see that you put a lot of effort in 
      this direction, and this is very encouraging.  
      Yet, I'd like to have some more background info. 
       
      Apart from that, there is one *huge* issue in Tcl 
      design that we ought to pay much more attention. 
      This is the Tcl object system and protected access 
      to Tcl objects accross threads. This is the part 
      that deserves more time than wrapping the very 
      last bit of Posix and/or Win thread API. 
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  36. Ticket change [0152993d3c] (rid 119462) by elfring on 2003-11-19 22:09:22:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      I just want that your package will be completed. I hope that it will become more attractive to other developers if nothing is missing.
      
      The pthread interface that is used by the TCL library can be run on all systems that support it. The implementation "http://sources.redhat.com/pthreads-win32/" can be used for Windows platforms. Can this one "be better" than the TCL approach so far?
      
      The AOLserver can be improved with the support for reader and writer locks.
      
      Do you want to turn the synchronization primtivites into TCL objects?
      Would you like to provide synchronized data structures in the TCL object system?
      Or is this a similar thing like the command "thread::eval"?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  37. Ticket change [8174079ed6] (rid 117036) by vasiljevic on 2003-11-19 22:30:44:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      I understand. The thing is that we already have a  
      good API and we might improve on that by adding 
      more goodies (reader-writer locks for example). 
      But I doubt that by fully implementing whatever API 
      we will attract more people. I think we will attract 
      more people if things become simpler to use. 
      Threads are already complicated enough, per-se. 
      This is where I want to expand. Therefore, I did  
      threadpools. Now I'm thinking abut simpler cross-thread 
      interp syncing and tsv variable traces (more to come). 
      I will add the reader-writer locks (yes, they are already 
      in AOLserver) to the threading extension, plus support 
      for lset and new dictionary datatype. This will all give 
      you more tools in your toolbox. I have numerous other  
      plans, but one after another :) 
       
      As far as underlying OS-API is concerned, the Win 
      threads are in some respect superior to Posix. 
      Tcl has already using Win threads, so I see no benefit. 
      The Tcl thread API isolates you from the OS one and  
      it does this pretty good. It can be improved though 
      which is, as I understand, the topic of our discussion. 
       
      As for the Tcl object system, I'm thinking about  
      possibilities to introduce locking structs in Tcl  
      objects so they can be optionally shared across 
      threads (which is not the case now). This is however 
      far-reaching backwardly incompatible change which won't 
      see the light of day before 9.0 release or such. 
       
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  38. Ticket change [53971a6cf8] (rid 93785) by elfring on 2003-11-20 01:36:22:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      The RWL thing is an important goody. We've got different views for the pieces that should come next. Would like to publish anything about your "numerous other plans" to increase the user's patience?
      The pools make your package very attractive.
      
      There are a lot of people that would completely disagree with "superior" Windows threads. I think that every implementation like yours that offers condition variables is better than it.
      Which parts do you like from the Win32 programming interface?
      
      Do you mean data structures with "shared Tcl objects" that do not need to use the tsv interface?
      
      How are the chances to get more points from 1. to 13. answered?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  39. Ticket change [56c0e4bb99] (rid 94375) by vasiljevic on 2003-11-20 02:37:57:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      OK. The reader/writer locks are really piece  
      of cake. I do not generaly think those are good idea 
      for many reasons (starvation of threads) but here/there 
      they might be ok. 
      Yes, thread pools are a great vehicle for building 
      complex server suff things in Tcl alone. 
       
      For Win threads: there are places, for example, where 
      you can impersonate a thread for a specific user. 
      This is crucial for MT-servers (fileservers for example) 
      to enforce protection schemes. Posix does not allow 
      for this. 
      But I would not like to make this a two-person flame. 
      I do not program on Win. I even dont like it. I just 
      miss some things from Posix and I find them in Win api. 
       
      For shared tcl objects I mean the shared Tcl_Obj. 
      I went a long way to make it somehow "shared" in 
      tsv, but this is only a poor aproximation, not really 
      the "right thing". 
       
      Numerous other plans? Well... do tsv monitors 
      (aka traces) so people can build up simple notification 
      system when a tsv variable changes. 
      Then, add shared-memory persistence to tsv, so people can 
      share data in across processes as they can do across 
      threads. 
      Then, abstract threads/processes under one clean simple 
      API so you can create pools of processes or threads or 
      combined (this can be a very powerful thingy) out of Tcl. 
       
      Well, this is enough for the moment, right? :) 
      If you have some more ideas in that direction 
      (simple, easy to understand/use but powerful) 
      please step-out with them. I do not think that 
      implementing Tcl API for semaphores will make 
      peoples life easier ;) 
       
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  40. Ticket change [f46c0eb21f] (rid 129912) by elfring on 2003-11-20 18:08:28:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Thanks for this anwers.
      
      Which Win32 functions are you missing in the POSIX API?
      Shall we try to find more solutions together?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  41. Ticket change [a3f5332e73] (rid 110131) by vasiljevic on 2003-11-27 01:23:37:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      As promised, here is the small list of things 
      I'd like to TIP. 
       
      Add new calls: 
       Tcl_SetThreadSpecificData(keyPtr, data); 
       Tcl_GetThreadSpecificData(keyPtr); 
       Tcl_CreateThreadSpecificData(keyPtr, cleanupCallback); 
       
      The idea is to introduce better handling of thread 
      specific data for cleanup purposes. The current Tcl 
      implementation with simple exit callbacks shows some 
      limitations. 
       
      Add new calls: 
       Tcl_MutexTryLock(mutexPtr); 
       Tcl_SetMutexName(mutexPtr, mutexName); 
       Tcl_GetMutexName(mutexPtr); 
       Tcl_GetMutexLockAttempts(mutexPtr); 
       Tcl_GetMutexLockWaits(mutexPtr); 
       
      The idea here is to extend the mutex structure 
      to include some housekeeping counters. This 
      would allow for monitoring locking hotspots. 
       
      Add new calls: 
       Tcl_ConditionSignal(condPtr) 
       Tcl_ConditionWaitEx(condPtr, mutexPtr, timePtr) 
       
      The first one is simply missing. The second one 
      would return the cause of the exit (timer expired, 
      or variable signalled) which is not reported by 
      the current Tcl_ConditionWait() implementation. 
       
      Add new calls: 
       Tcl_RWLockWriteLock(rwlockPtr); 
       Tcl_RWLockReadLock(rwlockPtr); 
       Tcl_RWLockUnlock(rwlockPtr); 
       
      Not generally needed since could be implemented 
      by existing primitives, but simplifies work for 
      some people. This is a goodie only. 
      For the Tcl extension, this can be done in the 
      extension itself, so no core changes would be 
      needed. 
       
       
      Now, the reference implementation is pending. 
      I hope to get some time in next couple of weeks 
      and get it (finally) done. 
      Is there anything you might add to this? 
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  42. Ticket change [73e2957f4a] (rid 105113) by elfring on 2003-11-27 21:20:43:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      1. Yes - I want to add a couple of things.
      
      more introspection calls:
      Tcl_GetThreadSpecificDataKeys(keyIdsPtr);
      Tcl_GetMutexLockWaiters(mutexPtr, threadIdsPtr);
      ...
      
      I am unsure if names can help with the housekeeping. I think that pointers are enough for debugging.
      
      
      2. Check naming conventions
      Tcl_MutexTryLock(mutexPtr);
         or
      Tcl_TryLockMutex(mutexPtr);
         or
      Tcl_MutexLockTry(mutexPtr);
      
      
      3. Please answer some more questions from the previous communication.
      I repeat the topic "spin locks" and "attributes" for example.
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  43. Ticket change [46005e5975] (rid 99443) by elfring on 2003-12-24 04:42:19:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Can the following links give you more ideas for the TIP?
      
      - The C10K problem
        http://www.kegel.com/c10k.html
      
      - The Filament Runtime System
        http://www.cs.arizona.edu/people/filament/fil.html
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"
  44. Ticket change [f0c70d411c] (rid 109252) by elfring on 2004-03-20 03:23:32:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Are there any chances that the files that I appended as a suggestion in November will be reviewed?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. priority changed to: "6"
    5. username: "elfring"
  45. Ticket change [ef94468b08] (rid 109019) by elfring on 2004-08-13 15:48:53:

    1. icomment:
      Logged In: YES 
      user_id=572001
      
      Is a file appendix useful for version 2.6?
      
      
    2. login: "elfring"
    3. mimetype: "text/plain"
    4. username: "elfring"