unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Possible issue with mutexes
@ 2019-04-10  2:57 Herwig Hochleitner
  2019-04-10  3:11 ` Herwig Hochleitner
  0 siblings, 1 reply; 4+ messages in thread
From: Herwig Hochleitner @ 2019-04-10  2:57 UTC (permalink / raw)
  To: emacs-devel

Hello,

I've recently created a semaphore type, based on mutex and condition 
vars, for controlling parallelism in an elisp processor.

The project went well, so far, but now that I attempted to pull out this 
semaphore implementation and create a test for it, I've noticed 
behavior, that leads me to believe, that emacs' thread and mutex 
guarantees might not hold in all cases.

When running the [test 
case](https://github.com/webnf/semaphore.el/blob/306d5a84b99526213c3a7d367f8d8041961ea52a/test/emacs-semaphore-test.el), 
you would expect `test/semaphore/active-count` to be 0 at the end of a 
run, right? For me, it's wildly inconsistent at the end of a run and 
seems to become desynchronized among worker threads. In this [example 
run](https://hastebin.com/wigiwizabi.log) from my machine, it happens to 
settle at 10.

Am I doing this wrong, somehow?

If not, could somebody help me file a report? First post on this ML ...

kind regards




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-04-10 16:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-10  2:57 Possible issue with mutexes Herwig Hochleitner
2019-04-10  3:11 ` Herwig Hochleitner
2019-04-10 14:27   ` Eli Zaretskii
     [not found]     ` <79bd1b97-13e8-a761-04f8-417204a7df29@bendlas.net>
     [not found]       ` <83y34h6gkb.fsf@gnu.org>
2019-04-10 16:15         ` Herwig Hochleitner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).