Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
P

pbraun

@pbraun
About
Posts
167
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Should Hourly Consultants Get Raises?
    P pbraun

    Is it not true that as a consultant you are running your own business and therefore can raise your hourly rate when you deem it necessary? At the very least I would hope that is the case.

    Phil

    The Lounge question

  • Cooperisms
    P pbraun

    Sounds to me like a true pessimist, probably from years of experience. :)

    Phil

    Buzzword Bingo

  • OS Threads Scheduling
    P pbraun

    You would need to add functionality to the operating system scheduler to accomplish this and since Microsoft operating systems are closed source, it is doubtful at best that you would be able to see and modify the source for your intended purpose. What is the reason that the thread operations are critical? Is it that they need to be executed in order? Do they need to be executed one right after another? If yes is the answer to either of the last two questions, then critical sections is the answer your looking for.

    Phil

    C / C++ / MFC visual-studio c++

  • Pausing thread untill asynchronous operation finishes.
    P pbraun

    The way that I have implemented many solutions for this is to use a ManualResetEvent to pause the thread. Then when the work is complete in the second thread, set the ManualResetEvent allowing the first thread to continue.

    Phil

    C# csharp html com question career

  • Are child threads of an object destroyed when an object is destroyed.
    P pbraun

    The best solution for this is to use a flag in each thread that when set to true allows the thread to run. When this same flag is set to false, the thread exits. Then in the dispose method, set the flag to false and the threads will exit. This is called a co-operative exit which allows the thread to complete its current task before exiting. Using thread pool threads to complete your work may seem like a good idea, but one must remember that thread pool threads are not executed if the system is busy. In otherwords, if the work being done in a thread is critical, it should not be put in a thread pool thread. Using thread.abort() to terminate the thread means that if the thread will be interrupted during its execution and told to terminate. If the task being performed by the thread is critical and must be completed, using thread.abort() will at some point interrupt that task and cause problems.

    Phil

    C# debugging json workspace

  • Job Wanting Question
    P pbraun

    Hmmm. Absolutely. Its the best programming language ever. One must believe absolutely everything that Bill Gates says. He would never say anything that was not true. Oh, and everything you read on the internet is true. Oh hey, in case your interested, I've got some ocean front property in Arizona for sale.

    Phil

    The Lounge question csharp c++ help career

  • Job Wanting Question
    P pbraun

    The best answer I can give is "Let the project decide." The reason for that is if you try to use some assembly variant for user interface programming, it will take you longer than if you use some interpreted language such as a .Net based language. On the other hand, if you are writing specifically timed device interface source, then assembly is the way to go. C is a useful alternate for underjust less than real time processes, C++ will aid in understanding object oriented programming and is quite useful for interfacing with drivers and doing business logic. I would not use C++ for time critical operations. C# is quite useful for user interface logic. I would not use C# for time critical or software or even middle ware that requires a quick response. As others have said, learning one will aid with the others, but as any professional will note that has had experience with all of those languages, it's the libraries that one will take the longest to learn.

    Phil

    The Lounge question csharp c++ help career

  • Isynchronizeinvoke question
    P pbraun

    Are you building a control for a form?

    Phil

    .NET (Core and Framework) question csharp asp-net

  • TCP .Begin receive
    P pbraun

    If the buffer size is not hard coded, the process will have to retrieve one byte at a time from the socket and constantly resize the incoming buffer to accommodate the byte until the message has been received. That can be very time expensive. What can be done is on the receive side, set up a hard coded buffer size. Each time a message is received, pass that buffer up to another method that will parse the buffer copying it into a second buffer. Then the original buffer is cleared. When the next message is received, the same process happens again. Let the parsing method determine when the message is complete and further processing of the completed message is necessary. This requires some analysis of the message and how it is structured so that the receiving process can put the message back together correctly. There are many applications out there that do the second method effectively. In fact there are some examples on this web site of both methods.

    Phil

    C# csharp visual-studio help tutorial announcement

  • Run external app
    P pbraun

    Intellisense doesn't always work as expected. Try the following: 1. Recompile your code (this may work, but most likely not). 2. Close the tab (file) and reopen it. This should cause intellisense to look at the file again. 3. Restart the IDE. Beyound those three, you will have to delete all intermediate files including *.suo files. Then it should work again. The problem that I see here is that intellisense is not working as expected.

    Phil

    .NET (Core and Framework) csharp visual-studio question

  • controlled launching of multiple instances
    P pbraun

    Are the multiple instances of the application to be launched on the same system or networked computers? How many different operating modes are allowed? Two? More than two?

    Phil

    C# csharp tutorial

  • #if NOT_USED
    P pbraun

    Actually the point is that there are many other ways to exclude code from being compiled, but using #ifdef NOT_USED creates confusion as to the intentions of the original developer. I prefer to be perfectly clear if I don't want the code compiled and either comment it out (with an explanation) or delete it entirely.

    Phil

    The Weird and The Wonderful help

  • #if NOT_USED
    P pbraun

    In my recent quests to solve an issue with legacy code, I found several places where code blocks are wrapped in #if NOT_USED ... #endif This is confusing to me since if NOT_USED is defined, then the code will be compiled into the project.

    Phil

    The Weird and The Wonderful help

  • parallel programming in c#?????????
    P pbraun

    Unless they've changed the scheduler in XP SP? and Vista for user processes, user processes are only scheduled on CPU 0. You can check this by writing a simple process that displays the CPU identifier and makes the CPU busy. Then run a few instances of the process to see which CPU they end up on. I don't have the source code for the test program I used to check that with anymore. It will take some time to re-create it.

    Phil

    C# question csharp help

  • parallel programming in c#?????????
    P pbraun

    As previous comments have stated, threading is not equivalent to paralellel processing. Currently MS operating systems do not choose a processor for a thread or a process to run on. That has to be done in the application by the application. If you would like to further investigate this, MSDN has some examples and I am not certain that CP does or does not.

    Phil

    C# question csharp help

  • Obtaining a HANDLE from IO.Ports.SerialPort
    P pbraun

    If I am remembering right the handle you are looking for is ".SafeHandle". Just look down the intellisense list.

    Phil

    C# help question

  • Converting code from C#.NET to VB.NET
    P pbraun

    I fought with the rounding issue for about a week trying to understand it. Then I found the MS documentation that states that MS uses bankers rounding. Bankers rounding means rounding to the nearest even number. Hence all values from 1 to 3 round to 2 and all values 3 to 5 round to 4 and so on. Its a frustrating problem, but casting should not be affected.

    Phil

    Clever Code csharp help

  • Need fast way to populate treeView
    P pbraun

    I agree. The approach is wrong. There are other approaches that work better. I'm betting that someone somewhere has implemented a control that can keep a portion of the file in the visible window while the user scrolls up or down. It may not be the ideal solution, but it definitely is not the worst.

    Phil

    C# csharp question

  • How to check a string to see if it’s valid for use in creating a file name
    P pbraun

    But if its speed you want, catching the exception may not be the best solution.

    Phil

    C# c++ tutorial question

  • My boss! [modified]
    P pbraun

    Have you ever seen FORTRAN 66, BASIC as it was implemented on an Apple IIe? In the light of those languages, this code seems quite reasonable. If you can, try to find out the background of your Boss' and that will help explain why he does what he does.

    Phil

    The Weird and The Wonderful
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups