[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Multithreading with Pth HOWTO
From: Roberto Alsina <ralsina () unl ! edu ! ar>
Date: 2000-03-07 8:20:05
[Download RAW message or body]
On Tue, 7 Mar 2000, Andreas Zehender wrote:
> Roberto Alsina wrote:
> > void *slotDoLongThingThread(void *arg);
> >
> > void MyButton::slotDoLongThing(void)
> > {
> > //This defines some aspects of the child thread, look at the Pth
> > //docs.
> > pth_attr_t attr = pth_attr_new();
> > pth_attr_set(attr,PTH_ATTR_CANCEL_STATE,PTH_CANCEL_ASYNCHRONOUS);
> > pth_attr_set(attr,PTH_ATTR_JOINABLE,FALSE);
> > pth_attr_set(attr, PTH_ATTR_STACK_SIZE, 128*1024);
> > pth_spawn(attr,query_actions_thread,this);
> > }
>
> What is query_actions_thread here? Do you mean slotDoLongThingThread?
> Or how is slotDoLongThingThread called?
Yikes, that's what I get by trying to write examples by copy/paste ;-)
It is indeed slotDoLongThingThread.
>
> >
> > //The real function that does the work.
> > void *slotDoLongThingThread(void *arg)
> > {
> > MyButton *myb=(MyButton *)arg;
> > bool a;
> > for (;a;)
> > {
> > a=doSomething();
> > myb->doThingWithButton();
> > pth_yield(NULL);
> > }
> > return NULL;
> > }
> >
>
> Greetings, Andreas
> --
> ------------------------------------------------------------------------
> Andreas Zehender http://www.ba-stuttgart.de/~azehende
> BA-Stuttgart mailto:azehende@ba-stuttgart.de
> 6. Semester ////
> Informationstechnik (o o)
> ------------------------oOO--(_)--OOo-----------------------------------
>
>
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) ralsina@unl.edu.ar
(_Y_.)' ._ ) `._`. " -.-' Centro de Telematica
_..`-'_..-_/ /-'_.' Universidad Nacional del Litoral
(l)-'' ((i).' ((!.' Santa Fe - Argentina
KDE Developer (MFCH)
The stone age didn't end for a lack of stone" Firoz Rasul
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic