[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[no subject]
CPAN seems to be having a few modules that should help passing blessed
instances between threads.
--=20
Emmanuel Rodriguez
--001636c5b5174da05d0469cd0891
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<br><br><div class=3D"gmail_quote">2009/5/13 =E5=94=90=E7=91=9E=E5=8D=9A <s=
pan dir=3D"ltr"><<a href=3D"mailto:ruibotang gmail com">ruibotang gmail =
com</a>></span><br><blockquote class=3D"gmail_quote" style=3D"border-lef=
t: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1=
ex;">
<div>hi, muppet,</div>
<div>=C2=A0</div>
<div>Many thanks=C2=A0for your suggestion,=C2=A0sorry for late to response.=
=C2=A0</div>
<div>=C2=A0</div>
<div>I have tried the three methods you mentioned (gdk lock; Glib::Idle=C2=
=A0 and a variant technique), and found an alternative solution for my issu=
e.=C2=A0 But there still exist other unsolved issues, as below</div>
<div>=C2=A0</div>
<div>For the gdk lock method, I have used Gtk2::Gdk::Threads->enter and =
Gtk2::Gdk::Threads->leave in my background thread, it seem that it can u=
pdate all the widgets(like button, labes) correctly excepte the Gtk2::TreeM=
odel(I used a Gtk2::ListStore actually).=C2=A0 when i use the Gtk2::TreeMod=
el->set() method, it will fail and says "Usage: Gtk2::TreeModel->=
;set($liststore, $iter, $col.....)" , and then the exit.=C2=A0=C2=A0=
=C2=A0I checked my code and found that I have a column with type Glib::Scal=
ar in my treemodel, in this column i assign a pointer to an new constructed=
object ( the object is not a subclass of Glib::Object, and have not declea=
red as shared), I do not know if=C2=A0the fail have relationship with this =
object? </div>
<div>=C2=A0</div></blockquote><div>From what I understood perl has a lot of=
troubles with threads and objects (blessed references). I recall when thre=
ads where first available in Perl that sharing blessed references will loos=
e the blessing. The data is passed intact to the other thread but the bless=
ing is lost, this makes calling methods on objects useless. I'm not sur=
e if this is the issue with your program but your should keep it in mind.<b=
r>
=C2=A0<br>CPAN seems to be having a few modules that should help passing bl=
essed instances between threads.<br><br></div></div>-- <br>Emmanuel Rodrigu=
ez<br>
--001636c5b5174da05d0469cd0891--
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]