www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - win32 waitnotify library & requirement of dummy var ?

reply Dan <ddaglas gmail.com> writes:
All,

The attached zip file contains a Win32 implementation for Java's
wait()/notify()/notifyAll() functionality for D.

If you examine the source file waitnotify.d, it contains the following
declaration in the WaitNotifyObject class:

public bool dummy = false;

It is an unused variable.  With it in there, the library works fine.  When I
take out the dummy variable, Access Violations occur.  (Try compiling by
issuing "make" and run "main.exe".)

Why is this happening?  Is it a problem with the compiler?  With the public.d
/ privateImpl.d paradigm in use?  Is it an alignment issue?

--Dan
begin 644 waitnotify.zip
M4$L#!!0`"``(`"NPDC4````````````````)``0`345402U)3D8O_LH```,`
M4$L'"``````"`````````%!+`P04`` `"``KL)(U````````````````%```
M`$U%5$$M24Y&+TU!3DE&15-4+DU&\TW,RTQ++2[1#4LM*L[,S[-2,-0SX.5R
M+DI-+$E-T76J!`F8ZAG$&Y J:`27YBGX9B87Y1=7%I>DYA8K>.8EZVGR<O%R
M`0!02P<(`=72<T<```!'````4$L#!!0`"``(`#.3DC4````````````````&
M````;6%I;BYDO5513]LP$'ZF4O_#T8?)$5T*G=A#,S1!J012-T8IFJ9M0B:Y
M-A:I'6R'JIK8;Y\=NZ2!#)`F3:H?XOO\W7=WG]U>#PX+G0HY &/*S9IG5+5;
MO1Z,68Q<X0#RXCIC,21B01DO0U^IY(S/!\`%?YM+D12Q9H+#;4$SIE<0BP1#
M $N%0#6L1"%!+#E(IF["=JO=8HM<2`U*)Z%93$2U+9U*I$E]+PXU6V!D#YO\
M!8_%8H%< ^`(8 8Z19B)+!-+*ZO=ND.IK*`#F(XNIE?#;\/QZ?#JZ'`R.1U-
M(LOQ"'%^.;H<-04N1I\.OYR<349E;A\D#:P!_-HH+5[%IF?75$J&LCS*C%K;
M0%("`>RW+/B5Q[CMK:5D&F<9)QU/"R>GT^U.8"BVJCZ$*D/,R5ZY+5$7DL-N
M9%GO;2J`89G^R%&#3V%*XKBLQ\A^%]YLR` B1^#5K56E+$.B98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DN.4#4
M&/P+Y&L+=#^_6`%C?S8QRDXZF]AI)\W\'/X^35YY[0:M2[4;4NT'[$_X>XLO
MXN.'?GYY*KI>^7X#?V/2^:W,HQ;OT]G]")H^Z3&2IOUI,$WI J'S4^[<`)]Z
MB_B%'RULHK],+N)GE[YH%3E3!Y_W,K\OZ:2SN)#II"3MF?Y]^AF'"-^G&4?L
MH.Z,`W!`F]'/^*<YD_Y%/+#RKY=37>2U9M4!#(3S]%>(*^0U.K-[K4Z:\;T(
MC(<G^;L#FM'?>=#DRQR8V%,V^%_XR9[B*2"-*;!M\+HP`4=Z[RS_M`+&^"Q_
M[4O3_S4(375.A_Y*<3[_O]B+3_X4L_#3%4C]%9SWX/D#:<7/+PGY/GR.Q0KB
M.6R.K`"[?F8W^)TT\RO-S S6X<1U#JS#,_UJG'Z.?SU%9_WG1'2&/4QB)F7R
M5VDT*2AA-ZAA)NBS5,$R[119QB"Z_MIG2`&9^O#Y4ZX,5X"=<UA <L67#;.X
MR^ZDL_R=`O3]=/&T_Y_F__OG?P!02P<(V-4;'PX2````. ``4$L!`A0`%``(
M`` `*["2-0`````"``````````D`!````````````````````$U%5$$M24Y&
M+_[*``!02P$"%``4`` `"``KL)(U`=72<T<```!'````%```````````````
M```]````345402U)3D8O34%.249%4U0N34902P$"%``4`` `"``SDY(U5=&=
M9, "``"L!P``! ````````````````#&````;6%I;BYD4$L!`A0`%``(`` `
M,9.2-8L `4H9`0``]P$```\`````````````````P ,``&-Y8VQI8V)A<G)I
M97(N9%!+`0(4`!0`"``(`#*3DC5\U2!<\`$``-H$```3````````````````
M`! %``!C>6-L:6-B87)R:65R26UP;"YD4$L!`A0`%``(`` `-).2-:^./YW0
M!0``'!(```<`````````````````20<``'%U975E+F102P$"%``4`` `"``U
MDY(URE`\CDL!``!J` ``"P````````````````!.#0``<V5M87!H;W)E+F10
M2P$"%``4`` `"``VDY(U##O-.`4#``!K"0``#P````````````````#2# ``
M<V5M87!H;W)E26UP;"YD4$L!`A0`%``(`` `-Y.2->X2QC)M`0``<P(```P`
M````````````````%!(``'=A:71N;W1I9GDN9%!+`0(4`!0`"``(`"Z3DC5#
MZV`GF $``/ #```0`````````````````+L3``!W86ET;F]T:69Y26UP;"YD
M4$L!`A0`%``(`` `/).2->E;W"FA!P``QA<```<`````````````````DQ4`
M`&UU=&5X+F-02P$"%``4`` `"`!/DY(U);+Q"U$#```P! ``" ``````````
M``````!I'0``4D5!1$U%+G1X=%!+`0(4`!0`"``(`$V3DC4&><$Q,````#,`
M```+`````````````````/( ``!#2$%.1T53+G1X=%!+`0(4`!0`"``(`"JP
MDC78U1L?#A(````Z```.`````````````````%LA``!W86ET;F]T:69Y+FQI
78E!+!08`````# `.`#0#``"E,P``````
`
end
Dec 18 2006
parent reply catrino <catrino cbs.cnrs.fr> writes:
Thank you for your waitnotify library. I was looking for something like this. I
have implemented something myself but your implementation is better. I believe
these wait(), notify() functionalities should be part of the Object class, which
means to recompile phobos. The problem is that it is not possible to add members
to the Object class. I've tried that and the compiler fails on an assertion on
the
Object size.

For your SIGSEGV problem, I believe that it is due to the public/private
implementation. In your waitnotifyImpl.d you added an int member to the
WaitNotifyObject. It means that the size of a WaitNotifyObject will be the size
of
Object + the size of an int. In your public waitnotify.d, if you don't add a
member the WaitNotifyObject will appear to have the same size of a basic Object
but it is bigger in fact. I believe the hidden int member gets altered by other
objects in memory, the place where it lies looks available. I had similar
problems
when I was playing with phobos (adding members to classes and recompiling).

Another thing that is important when using public/private implementation is to
always keep the methods in the same order. This is because the D compiler stores
the methods in the virtual function table in the order they appear in the source
file. For example if you have a public file like this :
class A {
   void fun();
   void afun();
}
and a private file like this
class A {
   void afun() { ... }
   void fun() { ... }
}
then when you will call A.fun() from a program importing your public d file and
linked with your already compiled private implementation you will have A.afun()
called instead. The same happens when you try to call A.afun(), you call A.fun()
instead.
I had this problem too.

I hope you could read my poor english and that I could help you.

Vincent
Dec 19 2006
parent Dan <ddaglas gmail.com> writes:
== Quote from catrino (catrino cbs.cnrs.fr)'s article
 Thank you for your waitnotify library. I was looking for something like this. I
 have implemented something myself but your implementation is better. I believe
 these wait(), notify() functionalities should be part of the Object class,
which
 means to recompile phobos. The problem is that it is not possible to add
members
 to the Object class. I've tried that and the compiler fails on an assertion on
the
 Object size.
 For your SIGSEGV problem, I believe that it is due to the public/private
 implementation. In your waitnotifyImpl.d you added an int member to the
 WaitNotifyObject. It means that the size of a WaitNotifyObject will be the
size of
 Object + the size of an int. In your public waitnotify.d, if you don't add a
 member the WaitNotifyObject will appear to have the same size of a basic Object
 but it is bigger in fact. I believe the hidden int member gets altered by other
 objects in memory, the place where it lies looks available. I had similar
problems
 when I was playing with phobos (adding members to classes and recompiling).
 Another thing that is important when using public/private implementation is to
 always keep the methods in the same order. This is because the D compiler
stores
 the methods in the virtual function table in the order they appear in the
source
 file. For example if you have a public file like this :
 class A {
    void fun();
    void afun();
 }
 and a private file like this
 class A {
    void afun() { ... }
    void fun() { ... }
 }
 then when you will call A.fun() from a program importing your public d file and
 linked with your already compiled private implementation you will have A.afun()
 called instead. The same happens when you try to call A.afun(), you call
A.fun()
 instead.
 I had this problem too.
 I hope you could read my poor english and that I could help you.
 Vincent
Vincent, I appreciate the advice. I will try a few things, like experimenting with volatile, making sure methods are in the same order, etc. Thanks. Dan
Dec 20 2006