Multithreaded CLX: queue-event and wait-for-event
Daniel Barlow <[email protected]> Sat, 19 Jul 2003 17:32:19 +0100
| Newsgroups | gmane.lisp.clx.devel |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Suppose two threads (processes, to use the lispm-speak) A and B. A is running an event loop, so calls process-event or some related public function. According to my reading of input.lisp, process-event eventually calls wait-for-event, which calls buffer-input-wait, which calls buffer-input-wait-default, which blocks (or pseudo-blocks, if you have userland threads) waiting for input on a file descriptor. If thread B calls queue-event to add to the event queue while A is blocked waiting for network input, A will not notice this - it just continues waiting. Is this correct? Intentional? Desirable? The context: I'm looking at read-input with a view to making it use thread synchronisation stuff that we have a reasonable hope of implementing efficently on a native (OS) threaded system. The above came to light while reading through input.lisp to work out what it does. Any input welcome. - -dan - -- http://www.cliki.net/ - Link farm for free CL-on-Unix resources -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/GXKZHDK5ZnWQiRMRAswJAKDIbhsIr2mUG4/93IMm9tZYDohDSQCgqyyL bNv44A95FaUHywg4dGnG8gg= =DuVX -----END PGP SIGNATURE-----