Re: Debug help - ! in data sharing concurrency

2025-08-31 Thread Andy Valencia via Digitalmars-d-learn
On Sunday, 31 August 2025 at 22:53:51 UTC, Steven Schveighoffer wrote: `std.concurrency` is meant to make all these control flow systems easy to avoid races for, even in `@safe` code. Sending the boolean instead of keeping a pointer to a shared boolean can alleviate a lot of these problems.

Re: Debug help - ! in data sharing concurrency

2025-08-31 Thread Steven Schveighoffer via Digitalmars-d-learn
On Sunday, 31 August 2025 at 12:44:33 UTC, Brother Bill wrote: On Sunday, 31 August 2025 at 01:27:57 UTC, Steven Schveighoffer wrote: Why would your second iteration make a difference? Purely by chance! In fact, on my machine, it does not exit in either case. Welcome to the wonderful world of

Re: Debug help - ! in data sharing concurrency

2025-08-31 Thread Andy Valencia via Digitalmars-d-learn
On Sunday, 31 August 2025 at 12:44:33 UTC, Brother Bill wrote: FWIW, given that D supports Message Passing Concurrency, is Data Sharing Concurrency just there for D completeness, for those that want to live close to the iron. Speaking as a guy who did Unix kernel SMP for years, there are time

Re: Debug help - ! in data sharing concurrency

2025-08-31 Thread Brother Bill via Digitalmars-d-learn
On Sunday, 31 August 2025 at 01:27:57 UTC, Steven Schveighoffer wrote: Why would your second iteration make a difference? Purely by chance! In fact, on my machine, it does not exit in either case. Welcome to the wonderful world of race conditions and multithreading! So this was just 'bad' lu

Re: Debug help - ! in data sharing concurrency

2025-08-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On Saturday, 30 August 2025 at 22:05:49 UTC, Brother Bill wrote: A predicate (!*isDone) vs. (*isDone == false) seems to have different behavior, where I would expect identical behavior. What am I missing? This program runs forever, even though isDone changes from false to true. ```d import

Debug help - ! in data sharing concurrency

2025-08-30 Thread Brother Bill via Digitalmars-d-learn
A predicate (!*isDone) vs. (*isDone == false) seems to have different behavior, where I would expect identical behavior. What am I missing? This program runs forever, even though isDone changes from false to true. ``` import std.stdio; import std.concurrency; import core.thread; import core.