Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005795 [Squeak] Collections minor always 01-20-07 14:39 01-20-07 14:45
Reporter R4p70r View Status public  
Assigned To
Priority normal Resolution open Platform
Status new   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 3.9
  Product Build
Summary 0005795: TranscriptStream is not completely thread safe
Description TranscriptStream is expected to be thread safe and there's a semaphore critical section in #endEntry to ensure this.

But before #endEntry gets to display the stream content, the #show: method first has to put something on the TranscriptStream and that's _not_ thread safe.
Steps To Reproduce
Additional Information A simple test. The 'b' rarely appears when you evaluate this:

Transcript clear.
[Transcript show: (String new: 1000 withAll: $a)] fork.
[Transcript show: $b] fork.

Fix 2 places the critical section in #show instead of #endEntry
Attached Files  FixTranscriptStream-Threads-alexj.2.cs [^] (520 bytes) 01-20-07 14:40
 FixTranscriptStream-Threads-alexj.3.cs [^] (1,059 bytes) 01-20-07 14:45

- Relationships

- Notes
(0009088 - 289 - 313 - 313 - 313 - 313 - 313)
R4p70r
01-20-07 14:44
edited on: 01-20-07 14:49

Fix number 3 uses a monitor instead. In both #endEntry and #show:

Keeping #critical: in #endEntry may help since several methods call #endEntry directly. Note that won't work perfectly since in thoses methods send stream messages before calling #endEntry and they are not thread safe.

 

- Issue History
Date Modified Username Field Change
01-20-07 14:39 R4p70r New Issue
01-20-07 14:40 R4p70r File Added: FixTranscriptStream-Threads-alexj.2.cs
01-20-07 14:44 R4p70r Note Added: 0009088
01-20-07 14:45 R4p70r File Added: FixTranscriptStream-Threads-alexj.3.cs
01-20-07 14:46 R4p70r Note Edited: 0009088
01-20-07 14:49 R4p70r Note Edited: 0009088


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
41 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker