On Wednesday, 23 January 2013 at 07:11:59 UTC, Joshua Niehus
wrote:
Is it possible to create a shared signal class?
oh god... dont tell me __gshared !
Think i answered my own question, it got me to the next step.
going to have to read through those giant "shared" threads again
Is it possible to create a shared signal class?
I would like to create a shared signal class so some other
process that knows certain things can come along emit its info to
any observer:
import std.stdio, std.signals;
class Observer {
void watch(string msg) {
writeln(msg);
}
I've tested and the Chinese character issue really fixed!
But I have two more issues here.
1.for connect with DSNless string function provided by my
original code as below,I can not make it to connect successfully
with really database file.Don't now why yours works.
bool connect(string connec
On Thursday, 17 January 2013 at 18:36:16 UTC, Regan Heath wrote:
On Mon, 14 Jan 2013 10:02:04 -, Regan Heath
wrote:
Ok, solved the issue I think.
Appreciatd all the help and am very excited that it finaly
works,WOW!
Now I can see (in Visual-D debugger) the Chinese characters in
the ro
On 1/22/13, cal wrote:
> I am trying to compile a project using the Win32 api header's
> (the Dsource ones) with 2.061 and am getting errors for the first
> time with things like this:
Try making these changes:
https://github.com/AndrejMitrovic/WindowsAPI/commit/6d8ef98508063c5a4741c72eda68aa485d
On Tuesday, 22 January 2013 at 22:15:13 UTC, Namespace wrote:
In my distress I have now tried with dmd_msc_vs10.
I get no such error but others:
1>cl : Befehlszeile warning D9025: "/TC" wird durch "/TP"
überschrieben
1>mars.c(905): warning C4805: '!=': unsichere Kombination von
Typ 'char' mit
Am 22.01.2013 23:25, schrieb cal:
> const uint WINVER = blah
try:
static const uint WINVER = blah
But I have no idea why it changed
I am trying to compile a project using the Win32 api header's
(the Dsource ones) with 2.061 and am getting errors for the first
time with things like this:
const uint WINVER = blah
Error: variable WINVER cannot be read at compile time.
I just want to confirm if this is due to a change in the
In my distress I have now tried with dmd_msc_vs10.
I get no such error but others:
1>cl : Befehlszeile warning D9025: "/TC" wird durch "/TP"
überschrieben
1>mars.c(905): warning C4805: '!=': unsichere Kombination von Typ
'char' mit Typ 'bool' in einer Operation
1>c1xx : fatal error C1083: Datei
dmc prints before
Digital Mars Compiler Version 8.42n
and also after I replaced it with your version.
Have I forget something?
And still the same error. That weird. oO
On Tuesday, 22 January 2013 at 21:35:48 UTC, Namespace wrote:
dmc prints before
Digital Mars Compiler Version 8.42n
and also after I replaced it with your version.
Have I forget something?
And still the same error. That weird. oO
Ah, I forgot, sorry. I'm using:
Digital Mars Make Version 5.06
No idea.
Just updated my own dmd sources.
I rebuilt it fine with both dmc 852c and 856c, in both release
non-release :/
On Tuesday, 22 January 2013 at 20:47:46 UTC, Namespace wrote:
So what is wrong now? A few days ago it works fine. I don't
understand that. :/
Strange. That's what I do (verbatim), so it should work.
Which "make" is being called? What is your DMC?
Could you try it with *only* "X/dm/bin" in y
Maybe I should describe _exactly_ what I did to earn help.
I make a new directory with:
mkdir d
then I wrote
git clone git://github.com/D-Programming-Language/dmd.git
git clone git://github.com/D-Programming-Language/druntime.git
git clone git://github.com/D-Programming-Language/phobos.git
dir
and
After "Atomic Updates" from rosettacode.org, here is
"S-Expressions".
Problem: http://rosettacode.org/wiki/S-Expressions
Code: http://dpaste.dzfl.pl/fd485808
Comments, improvements?
On 01/22/2013 09:04 AM, monarch_dodra wrote:
I'm getting some errors with this program:
I can not reproduce this problem on Linux. Not with -m64 nor with -m32.
I don't think the following is necessary but it has been a workaround
for me in the past:
import core.thread;
void main(string[]
ixid:
I note you always seem to use "in" in your functions and on
reddit seemed to imply that this was the idiomatic way of using
D yet I recall Jonathan M Davies posting that using "in" was a
bad idea.
I think "in" is supposed to be(come) idiomatic, because it's
short, and it's supposed to
On Tuesday, 22 January 2013 at 18:10:27 UTC, cal wrote:
On Tuesday, 22 January 2013 at 09:47:25 UTC, monarch_dodra
wrote:
Avoids deadlock.
imagine 2 threads:
a: from 2 to 5.
b: from 5 to 2.
If both threads acquire their first lock, then you have a dead
lock, and your program is basically dead
On Monday, 21 January 2013 at 20:35:16 UTC, bearophile wrote:
qznc:
Code: http://dpaste.dzfl.pl/e6615a53
Any comments or improvements?
I have reformatted your code a little, according to the style
used in all other D entries of RosettaCode:
http://codepad.org/ceDyQ8lE
The usage of a sink
On Tuesday, 22 January 2013 at 09:47:25 UTC, monarch_dodra wrote:
Avoids deadlock.
imagine 2 threads:
a: from 2 to 5.
b: from 5 to 2.
If both threads acquire their first lock, then you have a dead
lock, and your program is basically dead.
By always locking low first, you avoid the deadlock i
On Tuesday, 22 January 2013 at 15:10:14 UTC, Namespace wrote:
On Tuesday, 22 January 2013 at 14:58:50 UTC, monarch_dodra
wrote:
On Tuesday, 22 January 2013 at 14:56:16 UTC, Namespace wrote:
Hm, has really no one an idea what's wrong? I'm followed
strict the steps that are described in the wiki.
Second try at a translation of the third Go version. It seems to
work correctly (comments welcome), but it seems slower:
http://codepad.org/y1LnjLl0
Bye,
bearophile
On Tuesday, 22 January 2013 at 15:01:59 UTC, monarch_dodra wrote:
TY. Gonna read everything.
I'm not enjoying this.
I'm getting some errors with this program:
//
import std.stdio, std.file;
import std.concurrency;
void main(string[] args)
{
auto iFile = File("input.txt", "r");
In core.atomic I think there is what's needed, cas and atomicOp:
I know what a cas is, but I don't have experience on this kind of
coding. First try at a translation (doesn't work yet, and the
global lock on buckets is missing still):
import core.atomic: atomicLoad, atomicOp, cas;
...
Martin Drasar:
Wild guess, but couldn't it be because the ddoc documentation
is inside
version(CoreDdoc) and not processed?
The question then becomes why is that version(CoreDdoc) used :-)
Bye,
bearophile
On Tuesday, 22 January 2013 at 14:58:50 UTC, monarch_dodra wrote:
On Tuesday, 22 January 2013 at 14:56:16 UTC, Namespace wrote:
Hm, has really no one an idea what's wrong? I'm followed
strict the steps that are described in the wiki.
Do you have the latest github dmd? Could just be that you
p
On 22.1.2013 16:00, bearophile wrote:
> Do you know why the site doesn't show the ddocs here?
> http://dlang.org/phobos/core_atomic.html
Wild guess, but couldn't it be because the ddoc documentation is inside
version(CoreDdoc) and not processed?
Martin
On Tuesday, 22 January 2013 at 12:27:12 UTC, Martin Drasar wrote:
Hi,
wouldn't this help you?
http://dlang.org/phobos/std_concurrency.html#.spawnLinked
According to documentation: Executes the supplied function in a
new
context represented by Tid. This new context is linked to the
calling
monarch_dodra:
D has attomic swap operations too, AFAIK.
In core.atomic I think there is what's needed, cas and atomicOp:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/atomic.d
Do you know why the site doesn't show the ddocs here?
http://dlang.org/phobos/core_atomic.
On Tuesday, 22 January 2013 at 14:56:16 UTC, Namespace wrote:
Hm, has really no one an idea what's wrong? I'm followed strict
the steps that are described in the wiki.
Do you have the latest github dmd? Could just be that you pulled
the code at the exact moment it wasn't compiling.
Hm, has really no one an idea what's wrong? I'm followed strict
the steps that are described in the wiki.
On 01/22/2013 04:26 AM, Martin Drasar wrote:
> On 22.1.2013 11:08, monarch_dodra wrote:
>> I was trying to do a simple program to test message passing.
> wouldn't this help you?
>
> http://dlang.org/phobos/std_concurrency.html#.spawnLinked
The following chapter may be helpful as well:
http://
On Tuesday, 22 January 2013 at 14:10:14 UTC, qznc wrote:
On Tuesday, 22 January 2013 at 10:27:58 UTC, bearophile wrote:
The Go language has four different solutions, one of them is:
http://rosettacode.org/wiki/Atomic_updates#Lock-free
From the site:
This version uses no locking for the phase
On Tuesday, 22 January 2013 at 10:27:58 UTC, bearophile wrote:
The Go language has four different solutions, one of them is:
http://rosettacode.org/wiki/Atomic_updates#Lock-free
From the site:
This version uses no locking for the phase where the
two clients are updating the buckets. Instead i
I have tried to scope the Mutex, but the D code gets a little
slower, I don't know why:
5,6d5
< import std.typecons: scoped;
< import std.traits: ReturnType;
19,22c17,19
< ReturnType!(scoped!Mutex) mtx;
< alias this = value;
< }
< // pragma(msg, Bucket.sizeof); // 52 byt
On 22.1.2013 11:08, monarch_dodra wrote:
> I was trying to do a simple program to test message passing.
>
> Basically, I have 1 owner, and 2 slave threads.
>
> I'm facing two problems:
>
> 1 ) First, I want the slaves to be informed of when the master dies in
> an abnormal way.
>
> TDPL suggest
Hey, me again.
I cloned dmd from git head and try to build it with: make
-fwin32.mak release
But I get these errors:
dmc -c -Ibackend;tk -DMARS -cpp -D -g -DUNITTEST -e -wx
-DDM_TARGET_CPU_X86=1 -
I. backend\cgelem
elerr,
^
elxxx.c(3) : Error: need explicit cast to conve
I have modified a bit the second and third Go versions on
Rosettacode,
The changes on the Go versions are only on my local copies of the
code.
Bye,
bearophile
monarch_dodra:
That's a good point, and I'm sure we could also have a version
of D that could also do it that way.
Someone is willing to create that second version for RosettaCode?
I have modified a bit the second and third Go versions on
Rosettacode, now there are 20 buckets and it shows th
On Tuesday, 22 January 2013 at 10:27:58 UTC, bearophile wrote:
I have modified a little the code on RosettaCode (no changes in
the logic).
monarch_dodra:
Avoids deadlock.
imagine 2 threads:
a: from 2 to 5.
b: from 5 to 2.
If both threads acquire their first lock, then you have a dead
lock,
On 01/21/2013 07:53 PM, Ali Çehreli wrote:
...
void foo(string s == "hello")() // ERROR; I don't think possible
{
// ...
}
void foo(string s : "hello")(){
// ...
}
It will remain the same until author of the pull request will
actually take time to fix test errors or whatever fails there.
AFAIR Brad is the one who should get most gratitude for that
nice CI suite.
Thanks, good to know. :)
I have modified a little the code on RosettaCode (no changes in
the logic).
monarch_dodra:
Avoids deadlock.
imagine 2 threads:
a: from 2 to 5.
b: from 5 to 2.
If both threads acquire their first lock, then you have a dead
lock, and your program is basically dead.
By always locking low fir
On Tuesday, 22 January 2013 at 09:29:07 UTC, Namespace wrote:
On Friday, 18 January 2013 at 13:13:03 UTC, Jacob Carlborg
wrote:
On 2013-01-18 14:07, Namespace wrote:
Despite the danger that this annoy you probably:
What about pull 1019
(https://github.com/D-Programming-Language/dmd/pull/1019)?
I was trying to do a simple program to test message passing.
Basically, I have 1 owner, and 2 slave threads.
I'm facing two problems:
1 ) First, I want the slaves to be informed of when the master
dies in an abnormal way.
TDPL suggest OwnerFailed, but apparently, the out of band
exception t
On Tuesday, 22 January 2013 at 09:26:25 UTC, cal wrote:
On Tuesday, 22 January 2013 at 08:12:03 UTC, qznc wrote:
On Tuesday, 22 January 2013 at 00:10:22 UTC, bearophile wrote:
I suggest to put your code on Rosettacode now, and then we'll
do the changes there... As you see in other answers, both
On Friday, 18 January 2013 at 13:13:03 UTC, Jacob Carlborg wrote:
On 2013-01-18 14:07, Namespace wrote:
Despite the danger that this annoy you probably:
What about pull 1019
(https://github.com/D-Programming-Language/dmd/pull/1019)? I'm
still
quite new with Git so I do not know exactly what "1
On Tuesday, 22 January 2013 at 08:12:03 UTC, qznc wrote:
On Tuesday, 22 January 2013 at 00:10:22 UTC, bearophile wrote:
I suggest to put your code on Rosettacode now, and then we'll
do the changes there... As you see in other answers, both me
and monarch_dodra have other ideas for improvements.
On Tuesday, 22 January 2013 at 00:10:22 UTC, bearophile wrote:
I suggest to put your code on Rosettacode now, and then we'll
do the changes there... As you see in other answers, both me
and monarch_dodra have other ideas for improvements.
Ok, posted it.
http://rosettacode.org/wiki/Atomic_upda
49 matches
Mail list logo