• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Realease a thread back to threadpool

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Currently I am working in a application where spring thread pool is implemented. In the run method I need to check the next saving time from the db with the current system time. If next saving time is greater than current time this thread to be stopped and release back to the pool.

How can I achieve this. Please guide me in this.
 
Ranch Hand
Posts: 199
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think that you have to take another approximation and only send a task to the pool when is required the next saving time.
You need two different types of task one to decide when is the save time and other/s task/s that do the saving (this tasks are pooled).

Sorry if I have misunderstood the scenario.

Best regards,
 
Raaja Gotluru
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Carles,

Thanks for the reply. I did it in reverse order instead of checking greaterthan I have checked for less than condition. If the next saving time is less than current time I am processing my data else I wont do any thing ie that thread will written back to pool as it has finished processing.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic