Overview
| Artifact ID: | d3166e28ff44524246b6cef3538ac251324f3887 |
|---|---|
| Ticket: | 417839ffffffffffffffffffffffffffffffffff
vwait bug |
| User & Date: | dkf on 2001-04-23 16:38:24 |
Changes
- assignee changed to: "dkf"
- closedate changed to: "2001-04-23T09:38:24"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 This is not a bug, but a consequence of the fact that [vwait]s *nest*, and outer [vwait]s cannot terminate before all event handlers (containing calls to [vwait] as it turns out) finish. In this case, you've got: main proc f2 vwait temp after handler proc f1 getLock vwait lock As you can see, the wait for temp won't finish while all that clutter inside it is still going, but until that happens, the assignment to lock won't happen and the inner wait for lock won't terminate. Hence DEADLOCK. No change of this behaviour is possible without a complete change of some pretty fundamental stuff (e.g. interpreters have to have multiple threads executing within them, meaning you need to introduce lots of semaphores and monitors, lots of code needs to be updated to no longer assume that event handlers run uninterruptably, etc.) The easiest way of fixing your code is probably to get rid of nested [vwait]s (and [update] and [tkwait] too) by never calling the command in an event handler (there are a few situations where it is useful, but this isn't one of them IMO) and to take advantage of the fact that event handlers will not be pre-empted by the interpreter. - login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Invalid"
- status changed to: "Closed"
- username: "dkf"