[Gambas-user] Tasks
Fabien Bodard
gambas.fr at ...626...
Wed Jan 29 19:21:25 CET 2014
Ok thank you ... i will investigate :/...
2014-01-29 Benoît Minisini <gambas at ...1...>:
> Le 28/01/2014 13:26, Fabien Bodard a écrit :
>> Hi Benoit,
>>
>> I'm currently working on a new viewer for reports. As drawing report in
>> real time is quite long, I use images stored in a collection to have a
>> buffer.
>>
>> I have trying to use task to process the painting of the report on an image
>> that I return through the value, like you are doing in fractal example.
>>
>> So in the _new I'm giving theses args :
>>
>> (Hreport as report, ipage as integer, fscale, iwidth, iheight)
>>
>> Then the main sub call $hreport.paint($ipage) to draw the page
>>
>> But a this point report class return an I/O error... Why ?
>
> I don't know, but you can't use QT4 or GTK+ reliably inside a task. :-(
>
>>
>> Can't I use a class instantiate in the main processus in the slave one ?
>>
>
> It depends. The task is a fork of the main process, so it can use
> everything theoritically, except when there is a file descriptor
> somewhere in the story: problems begin.
>
> As for QT4 or GTK+, I think you should be able to use them in a task as
> soon as there is no communication with the X server. You must test case
> by case and pray.
>
> Think about TTF fonts: it can be opened in the main process, then use in
> the child process, while being closed in the main process... Can it be a
> problem? I don't know.
>
>> In other hand, is there a way to re-use a task class after the return
>> without instanciate it a new time, and if it's possible, how to run it with
>> new args.
>
> No. If the task ends, the child process has disappeared, so you must
> create a new one. One task instance equals one process instance.
>
> --
> Benoît Minisini
>
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends. Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
--
Fabien Bodard
More information about the User
mailing list