|
|
Re: Jobs API [message #464632 is a reply to message #464619] |
Tue, 13 March 2007 15:00 |
Eclipse User |
|
|
|
Originally posted by: peter_ossipov.mail.ru
Why not use the current job API? Here it goes:
http://www.eclipse.org/articles/Article-Concurrency/jobs-api .html
You can run your jobs like job.schedule() and set the rules so, that all
the jobs are conflicting. In that case you will have only one job
running at a time and the rest will be queuing, eh?
Just read that article and you will have an idea. Do not forget the job
should be conflicting with itself. :-)
Danail Nachev wrote:
> Hi, Carsten
>
> This is a little strange question. The requirement you have that
> multiple jobs have to be executed sequentially defeats the purpose of
> jobs. Jobs are used when you want to execute multiple
> operations/processes concurrently. In your case single job will be
> enough I think. This job should execute whatever needed sequentially.
>
> Your case may be more complex and it needs multiple jobs to do its work,
> but currently I can't think of any such scenario.
>
> BR,
> Danail
>
> Carsten Spieker wrote:
>
>> Hi,
>>
>> I want to create a queue of Jobs that should be run sequentially in a thread
>> different from the UI Thread. So there should be the UI thread and one other
>> background thread which executes the queue of background jobs successively.
>>
>> In the UI there should appear the progress dialog with the "Run in
>> background" button and so on.
>>
>> I think I only have to know how to manage that the jobs I schedule are NOT
>> executed concurrenltly.
>>
>> Maybe someone has an idea about it?!
>>
>> Thanks
>>
>> Greetz,
>> Carsten
>>
>>
>>
|
|
|
Re: Jobs API [message #464633 is a reply to message #464632] |
Tue, 13 March 2007 15:04 |
Eclipse User |
|
|
|
Originally posted by: peter_ossipov.mail.ru
So, your rule could look like this:
public class SuperSchedulingRule implements ISchedulingRule
{
public boolean contains(ISchedulingRule rule)
{
return this == rule;
}
public boolean isConflicting(ISchedulingRule rule)
{
return rule instanceof SuperSchedulingRule;
}
}
This will allow all the jobs of a certain type be run one at a time.
Peter Osipov wrote:
> Why not use the current job API? Here it goes:
> http://www.eclipse.org/articles/Article-Concurrency/jobs-api .html
> You can run your jobs like job.schedule() and set the rules so, that
> all the jobs are conflicting. In that case you will have only one job
> running at a time and the rest will be queuing, eh?
> Just read that article and you will have an idea. Do not forget the
> job should be conflicting with itself. :-)
> Danail Nachev wrote:
>> Hi, Carsten
>>
>> This is a little strange question. The requirement you have that
>> multiple jobs have to be executed sequentially defeats the purpose of
>> jobs. Jobs are used when you want to execute multiple
>> operations/processes concurrently. In your case single job will be
>> enough I think. This job should execute whatever needed sequentially.
>>
>> Your case may be more complex and it needs multiple jobs to do its work,
>> but currently I can't think of any such scenario.
>>
>> BR,
>> Danail
>>
>> Carsten Spieker wrote:
>>
>>> Hi,
>>>
>>> I want to create a queue of Jobs that should be run sequentially in
>>> a thread different from the UI Thread. So there should be the UI
>>> thread and one other background thread which executes the queue of
>>> background jobs successively.
>>>
>>> In the UI there should appear the progress dialog with the "Run in
>>> background" button and so on.
>>>
>>> I think I only have to know how to manage that the jobs I schedule
>>> are NOT executed concurrenltly.
>>>
>>> Maybe someone has an idea about it?!
>>>
>>> Thanks
>>>
>>> Greetz,
>>> Carsten
>>>
>>>
|
|
|
Re: Jobs API [message #464712 is a reply to message #464633] |
Wed, 14 March 2007 06:23 |
Carsten Spieker Messages: 197 Registered: July 2009 |
Senior Member |
|
|
Ok, thank you both for your answers. I read the article and I also think
that the
solution with using scheduling rules is the best in my case.
Thanks!
Greetz,
Carsten
"Peter Osipov" <peter_ossipov@mail.ru> schrieb im Newsbeitrag
news:et6egd$h1m$2@utils.eclipse.org...
> So, your rule could look like this:
> public class SuperSchedulingRule implements ISchedulingRule
> {
> public boolean contains(ISchedulingRule rule)
> {
> return this == rule;
> }
>
> public boolean isConflicting(ISchedulingRule rule)
> {
> return rule instanceof SuperSchedulingRule;
> }
> }
> This will allow all the jobs of a certain type be run one at a time.
> Peter Osipov wrote:
>> Why not use the current job API? Here it goes:
>> http://www.eclipse.org/articles/Article-Concurrency/jobs-api .html
>> You can run your jobs like job.schedule() and set the rules so, that all
>> the jobs are conflicting. In that case you will have only one job running
>> at a time and the rest will be queuing, eh?
>> Just read that article and you will have an idea. Do not forget the job
>> should be conflicting with itself. :-)
>> Danail Nachev wrote:
>>> Hi, Carsten
>>>
>>> This is a little strange question. The requirement you have that
>>> multiple jobs have to be executed sequentially defeats the purpose of
>>> jobs. Jobs are used when you want to execute multiple
>>> operations/processes concurrently. In your case single job will be
>>> enough I think. This job should execute whatever needed sequentially.
>>>
>>> Your case may be more complex and it needs multiple jobs to do its work,
>>> but currently I can't think of any such scenario.
>>>
>>> BR,
>>> Danail
>>>
>>> Carsten Spieker wrote:
>>>
>>>> Hi,
>>>>
>>>> I want to create a queue of Jobs that should be run sequentially in a
>>>> thread different from the UI Thread. So there should be the UI thread
>>>> and one other background thread which executes the queue of background
>>>> jobs successively.
>>>>
>>>> In the UI there should appear the progress dialog with the "Run in
>>>> background" button and so on.
>>>>
>>>> I think I only have to know how to manage that the jobs I schedule are
>>>> NOT executed concurrenltly.
>>>>
>>>> Maybe someone has an idea about it?!
>>>>
>>>> Thanks
>>>>
>>>> Greetz,
>>>> Carsten
>>>>
>>>>
|
|
|
Powered by
FUDForum. Page generated in 0.03990 seconds