Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / January 2005

Tip: Looking for answers? Try searching our database.

MS VC++.NET 'release' command?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peteroid - 09 Jan 2005 15:54 GMT
I have a process that takes a long (i.e., sometimes minutes) to accomplish,
and I'd rather not write it as a 'time-slicing' process. Is there some sort
of Windows call that will allow this process to release the CPU for other
processes, yet will return where it left off auomatically? I use to program
in Visual Basic, and think there was something sort of  "release" command
that did this.Or does MS VC++.NET already do this automatically (i.e., time
slice the execution to allow for other processes)?

Thanks in advance! :)

[==Peteroid==]
William DePalo [MVP VC++] - 09 Jan 2005 20:10 GMT
>I have a process that takes a long (i.e., sometimes minutes) to accomplish,
> and I'd rather not write it as a 'time-slicing' process. Is there some
[quoted text clipped - 6 lines]
> time
> slice the execution to allow for other processes)?

The bad old days of a decade ago when 16 bit Windows applications could run
as long as they wanted without giving up the processor are long gone. These
days all of the 32 bit Windows platforms (9x,NT/XP) include a pre-emptive
scheduler so that 32 bits applications don't often have to consider what
else is running on the same box.

There is still some "weirdness" with respect to 16 bit applications on 9x
but as this is a .Net group and as .Net provides no support for 16 bit
applications it shouldn't matter.

Regards,
Will
Ioannis Vranos - 09 Jan 2005 23:38 GMT
> I have a process that takes a long (i.e., sometimes minutes) to accomplish,
> and I'd rather not write it as a 'time-slicing' process. Is there some sort
[quoted text clipped - 3 lines]
> that did this.Or does MS VC++.NET already do this automatically (i.e., time
> slice the execution to allow for other processes)?

In .NET check the classes Monitor and Thread.

Signature

Ioannis Vranos

Tom Widmer - 10 Jan 2005 09:53 GMT
> I have a process that takes a long (i.e., sometimes minutes) to accomplish,
> and I'd rather not write it as a 'time-slicing' process. Is there some sort
[quoted text clipped - 3 lines]
> that did this.Or does MS VC++.NET already do this automatically (i.e., time
> slice the execution to allow for other processes)?

It does it automatically, but I suggest you run your process at a low
priority to prevent it from causing problems with the responsiveness of
windows. Look up thread and process priority in the docs.

Tom
mosimu - 22 Jan 2005 08:01 GMT
Try Sleep(1) somewhere in your loop.  Run your program and watch in Task
Manager that CPU usage will be significantly lower and your computer will be
much more responsize.

> > I have a process that takes a long (i.e., sometimes minutes) to accomplish,
> > and I'd rather not write it as a 'time-slicing' process. Is there some sort
[quoted text clipped - 9 lines]
>
> Tom

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.