Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Jobs API
Jobs API [message #464617] Tue, 13 March 2007 06:53 Go to next message
Carsten Spieker is currently offline Carsten SpiekerFriend
Messages: 197
Registered: July 2009
Senior Member
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 #464619 is a reply to message #464617] Tue, 13 March 2007 08:11 Go to previous messageGo to next message
Danail Nachev is currently offline Danail NachevFriend
Messages: 110
Registered: July 2009
Senior Member
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 #464632 is a reply to message #464619] Tue, 13 March 2007 15:00 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Carsten Spieker is currently offline Carsten SpiekerFriend
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
>>>>
>>>>
Previous Topic:How to reference HTML inside jars
Next Topic:Saving our Custom Perspective in RCP Application
Goto Forum:
  


Current Time: Fri Sep 20 12:03:48 GMT 2024

Powered by FUDForum. Page generated in 0.04159 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top