Tcl Source Code

View Ticket
Login
Ticket UUID: 1202052
Title: Darwin: CFRunLoop based notifier
Type: Patch Version: None
Submitter: das Created on: 2005-05-14 18:28:19
Subsystem: 01. Notifier Assigned To: das
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2005-05-15 03:43:18
Resolution: Fixed Closed By: das
    Closed on: 2005-05-14 20:43:18
Description:
This patch implements a new CFRunLoop based notifier on Darwin to 
allow easy integration with other event loops on Mac OS X, in particular 
the TkAqua Carbon event loop can now be integrated via a standard tcl 
event source (instead of TkAqua upon loading having to finalize the 
exsting notifier and  replace it with its custom version, which has bad 
consequences for any fileevent handlers already established).

The new tclMacOSXNotify.c is very similar to the threaded tclUnixNotfy.c, 
except that the notifier thread uses a CFRunLoopSource to wake up tcl 
threads waiting for events in CFRunLoopRun. To allow use of this notifier 
in an untreaded core, we use pthread API directly and don't rely on tcl 
thread API. To reduce complexity only the minimal amount of pthread API 
necessary is used; for locking, we  use the low overhead OSSpinLockLock 
API (or the commpage _spin_lock SPI). The need for condition variables is 
removed by creating the trigger pipe from the main thread and using 
pthread_join to wait for notifier thread termination. Use of the tcl thread 
specific data API can remain because it is only used in threads with interps 
(i.e. not the notifier thread) and in the unthreaded case, there is only one 
such thread.
User Comments: das added on 2005-05-15 03:42:59:

File Added - 134489: tk-CFNotifier-core-8-4-branch.diff

das added on 2005-05-15 03:42:18:

File Added - 134488: tcl-CFNotifier-core-8-4-branch.diff

das added on 2005-05-15 03:41:39:

File Added - 134487: tk-CFNotifier-HEAD.diff

das added on 2005-05-15 03:41:00:

File Added - 134486: tcl-CFNotifier-HEAD.diff

Logged In: YES 
user_id=90580

committed to HEAD and core-8-4-branch.

Attachments: