多线程问题

Hello_JGM 2017-04-13 06:49:14
好久没研究PB,因为以前项目需要所以最近搞一下多线程,写了一个简单的demo测试一下,但是报错了,不太理解,不知道是不是自己哪里理解错了,求大神们指教
@WorldMobile @路人甲cw


SharedObjectRegister("uo_thread","ExpThreadInstance")
SharedObjectGet("ExpThreadInstance",thread_one)

thread_one.uf_setparent(parent)
thread_one.post uf_event( )


报错如图,


对应uo_thread类代码如下,是nonvisualobject
forward
global type uo_thread from nonvisualobject
end type
end forward

global type uo_thread from nonvisualobject
end type
global uo_thread uo_thread

type variables
window w_agu
end variables

forward prototypes
public subroutine uf_setparent (window w_get)
public subroutine uf_event ()
end prototypes

public subroutine uf_setparent (window w_get);w_agu = w_get
end subroutine

public subroutine uf_event ();w_agu.triggerevent("ue_event")
end subroutine

on uo_thread.create
call super::create
TriggerEvent( this, "constructor" )
end on

on uo_thread.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on


一直无法实现多线程效果,求大神指教,或者给我个思路,能写个简单的demo更好了
...全文
902 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hello_JGM 2017-06-25
  • 打赏
  • 举报
回复
引用 6 楼 lvxinzhi 的回复:
网上一搜一大把
就是在网上搜的帖子或者博文实现不了,才想求组的大神 不过最近在学习路大神的pfw,看pfw里的代理线程类库是如何实现的
Hello_JGM 2017-06-25
  • 打赏
  • 举报
回复
引用 8 楼 r00_a2lBUR 的回复:
感觉PB的timer事件也蛮好用的。
timer好用也代替不了线程啊
r00_a2lBUR 2017-06-24
  • 打赏
  • 举报
回复
感觉PB的timer事件也蛮好用的。
提前十分钟 2017-05-22
  • 打赏
  • 举报
回复
网上一搜一大把
seven125 2017-05-09
  • 打赏
  • 举报
回复
我也想知道怎么能实现,帮你顶下
Hello_JGM 2017-04-18
  • 打赏
  • 举报
回复
哎……,真的是没人了吗
Hello_JGM 2017-04-16
  • 打赏
  • 举报
回复
来个大神帮帮忙啊
Hello_JGM 2017-04-14
  • 打赏
  • 举报
回复
引用 1 楼 lvxinzhi 的回复:
多线程在PB下问题不少,如果编译为PBD还可以将就着用,编译为单独的 exe,程序退出来,还没有真的退出,要等好一会,系统才会去回收退出的程序
编译成PBD或者dll都可以,关键是现在我连多线程的简单demo都没搞定
提前十分钟 2017-04-14
  • 打赏
  • 举报
回复
多线程在PB下问题不少,如果编译为PBD还可以将就着用,编译为单独的 exe,程序退出来,还没有真的退出,要等好一会,系统才会去回收退出的程序

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧