Opened 9 years ago

Closed 9 years ago

#905 closed defect (fixed)

Apparent race condition in gui:background-process-run-function

Reported by: rongarret Owned by: gb
Priority: major Milestone:
Component: IDE Version: trunk
Keywords: Cc:



(dotimes (i 3) (gui:background-process-run-function "foo" (lambda () (print 123))))

results in one successfully spawned process and one that reports:

Error: "Untitled 2" already exists

(with one of the most horrifically long backtraces I have ever seen from a process that did not actually overflow the stack).

But this:

(dotimes (i 2) (gui:background-process-run-function "foo" (lambda () (print 123))) (sleep 0.01))

results in two successfully spawned processes. These results are repeatable for N>2. My guess is this is a race condition having to do with the naming of the windows that are created by the underlying deferred-cocoa-listener-output-streams but I have not been able to verify this.

Change History (2)

comment:1 Changed 9 years ago by gb

  • Owner set to gb
  • Status changed from new to assigned

comment:2 Changed 9 years ago by gb

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [15183]) In ENSURE-DEFERRED-STREAM-INFO-FOR-IO, force the document object (and all of the related infrastructure) to be created on the event thread. This is probably a good idea in general and doing this avoids the race condition described in ticket:905.

Hemlock buffer creation isn't really thread-safe; if we ever want it to be, we might want to do locking/serialization at a different level.

Fixes ticket:905 in the trunk.

Note: See TracTickets for help on using tickets.