Process Information

2019-02-23 Thread r-const-dev via Digitalmars-d-learn
Is there a way to get information about the current process? Memory usage, CPU usage, PID.

InsertBefore in DList of structs

2019-03-04 Thread r-const-dev via Digitalmars-d-learn
I have a DList of structs, DataPoint, ordered by a struct field, time. I'm trying to insert a new entry preserving order, so I'm trying to use `until` to find the insertion point and `insertBefore` with the result. struct DataPoint { immutable ulong time; ulong value; } void main() {

Re: Shared with synchronized

2019-03-03 Thread r-const-dev via Digitalmars-d-learn
On Sunday, 3 March 2019 at 22:35:54 UTC, r-const-dev wrote: I'm trying to implement a thread safe class, guarding data access with synchronized and atomicOp. Inside the class I'm using non-shared fields, such as Nullable, but I guarantee the thread safety using synchronized. How can I tell

Re: InsertBefore in DList of structs

2019-03-04 Thread r-const-dev via Digitalmars-d-learn
On Monday, 4 March 2019 at 10:09:19 UTC, drug wrote: On 04.03.2019 13:03, drug wrote: insertStable needs DList.Range, not Until!... one. You can do something like this https://run.dlang.io/is/A2vZjW Oops, it was wrong example, I'd recommend this way - https://run.dlang.io/is/ugPL8j ``` import

Re: InsertBefore in DList of structs

2019-03-05 Thread r-const-dev via Digitalmars-d-learn
On Tuesday, 5 March 2019 at 08:39:56 UTC, drug wrote: On 05.03.2019 2:01, r-const-dev wrote: [...] dataPoints is an aggregate type variable, not a range and slice operator opSlice/[] returns a range of this aggregate type. I have no appropriate links unfortunately but these can be useful

Shared with synchronized

2019-03-03 Thread r-const-dev via Digitalmars-d-learn
I'm trying to implement a thread safe class, guarding data access with synchronized and atomicOp. Inside the class I'm using non-shared fields, such as Nullable, but I guarantee the thread safety using synchronized. How can I tell the compiler to allow using non-shared fields/methods inside