Search Results

Search found 8588 results on 344 pages for 'thread abort'.

Page 109/344 | < Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >

  • Unload event for the default AppDomain?

    - by Zor
    Hi, I need to have an event fired whenever any AppDomain unloads - including the default one of the process. The problem with AppDomain.DomainUnload is that it only fires for non-default AppDomains. Furthermore, AppDomain.ProcessExit has limited execution time, which I cannot rely on. Any suggestions as to how I can achieve this would be greatly appreciated! (Alternatively, having an event fired when a background thread (Thread.IsBackground == True) works too.) Thanks in advance.

    Read the article

  • What is the fastest XML parser in PHP?

    - by Jakub Lédl
    Hi, for a certain project, I need some way to parse XML and get data from it. So I wonder, which one of built-in parsers is the fastest? Also, it would be nice of the parser could accept a XML string as input - I have my own implementation of thread-safe working with files and I don't want some nasty non-thread-safe libraries to make my efforts useless.

    Read the article

  • openmp sections running sequentially

    - by chi42
    I have the following code: #pragma omp parallel sections private(x,y,cpsrcptr) firstprivate(srcptr) lastprivate(srcptr) { #pragma omp section { //stuff } #pragma omp section { //stuff } } According to the Zoom profiler, two threads are created, one thread executes both the sections, and the other thread simply blocks! Has anyone encountered anything like this before? (And yes, I do have a dual core machine).

    Read the article

  • nonatomic property in model class when using NSOperationQueue (iPhone)?

    - by Andrew B.
    I have a custom model class with an NSMutableData ivar that will be accessed by custom NSOperation subclasses (using an NSOperationQueue). I think I can guarantee thread-safe access to the ivar from multiple NSOperations by using dependencies, and I can guarantee that I don't access the ivar from other code (say my main app thread) by waiting until the Q has finished all operations. Should I use a nonatomic property specification, or leave it atomic? Is there a significant impact on performance?

    Read the article

  • Where to begin with multi-threaded programming with c++?

    - by zoke
    I'm trying to implement my own IRC client as a personal proejct and I realized I needed a way to read and write from the socket at the same time. I realized I could have a reading thread which reads from the socket in the background and puts data in a queue and I could have another thread which writes data from a queue to the socket. However I have no idea on how to start with multithreaded programing or how to do it with c++. Where do I go from here?

    Read the article

  • BSoD when creating threads

    - by Behrooz
    I am trying to create +5 threads synchronously so there shouldn't be any concurrency error. Code: System.Threading.Thread t = new System.Threading.Thread(proc); t.Start();//==t.BlueScreen(); t.Join(); Is darkness a feature ? I am doing something wrong? OS:Microsoft windows vista(unfortunately) x64 Language:C# 3.0|4.0 .Net version:3.5|4

    Read the article

  • Tools for Debugging ThreadPool Issues in Visual Studio 2010.

    - by ProfK
    I have never spent much time debugging multithreaded .NET apps (or others), and have quite a simple one to solve very quickly. Ideally I would imagined and would lurve to be able to intercept thread creation and use by worker objects, so that nothing unexpected happens while I'm on a breakpoint in my thread. Is that realistic? What else is there in VS 2010?

    Read the article

  • How to implement "short" nested vanity urls in rails?

    - by UnSandpiper
    I understand how to create a vanity URL in Rails in order to translate http://mysite.com/forum/1 into http://mysite.com/some-forum-name But I'd like to take it a step further and get the following working (if it is possible at all): Instead of: http://mysite.com/forum/1/board/99/thread/321 I'd like in the first step to get to something like this: http://mysite.com/1/99/321 and ultimately have it like http://mysite.com/some-forum-name/some-board-name/this-is-the-thread-subject. Is this possible?

    Read the article

  • ConcurrenctBag(Of MyType) Vs List(Of MyType)

    - by Ben
    What is the advantage of using a ConcurrentBag(Of MyType) against just using a List(Of MyType)? The MSDN page on the CB (http://msdn.microsoft.com/en-us/library/dd381779(v=VS.100).aspx) states that ConcurrentBag(Of T) is a thread-safe bag implementation, optimized for scenarios where the same thread will be both producing and consuming data stored in the bag So what is the advantage? I can understand the advantage of the other collection types in the Concurrency namespace, but this one puzzled me. Thanks.

    Read the article

  • SQL Server stored procedure in multi threaded environments

    - by Shamika
    Hi, I need to execute some Sql server stored procs in a thread safe manner. At the moment I'm using software locks (C# locks) to achieve this but wonder what kind of features provided by the Sql server itself to achieve thread safety. It seems to be there are some table and row locking features built in to Sql server. Also from a performance perspective what is best approach? Software locks? Or Sql Server built in locks? Thanks, Shamika

    Read the article

  • outllook addin threading issues

    - by Sanju
    hi i am having threading issues in my vsto project // code for function var threadUpdate = new Thread(_fun){IsBackgroud = true}; threadUpdate.Start(); threadList.add(threadUpdate); // code for progressbar Progressbar pb = new Prgressbar(){Title =@"abc"} pb.Show() it was working in perfect condition before i add wpf progress bar. as the plugin has been running as single thread can i ask how can running multi threading in outlook thanks

    Read the article

  • Why should Java ThreadLocal variables be static

    - by kellyfj
    I was reading that JavaDoc for Threadlocal here http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ThreadLocal.html and it says "ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID). " But my question is why did they choose to make it static (typically) - it makes it a bit confusing to have "per thread" state but its static?

    Read the article

  • What are some jQuery plugins that you've desired?

    - by meder
    While I'm pretty sure this might just get closed, I might just have some free time on my hands so I'm opening a request thread to see if anyone desires a jQuery plugin that I might be able to provide - if you have a specific request for a plugin that you can't find which isn't overly demanding ( such as a game ) can you reply to this thread?

    Read the article

  • How to handle asynchronous socket receiving in C++?

    - by Overv
    I'm currently using a thread to handle Connect and Send calls asynchronously. This is all working fine, but now I want to make receiving asynchronous too. How should I receive data without pausing the whole queue while waiting for data? The only solution I can think of right now is a second thread.

    Read the article

  • What to throw in a C++ class wrapping a C library ?

    - by ereOn
    I have to create a set of wrapping C++ classes around an existing C library. For many objects of the C library, the construction is done by calling something like britney_spears* create_britney_spears() and the opposite function void free_britney_spears(britney_spears* brit). If the allocation of a britney_spears fails, create_britney_spears() returns NULL. This is, as far as I know, a very common pattern. Now I want to wrap this inside a C++ class. //britney_spears.hpp class BritneySpears { public: BritneySpears(); private: boost::shared_ptr<britney_spears> m_britney_spears; }; And here is the implementation: // britney_spears.cpp BritneySpears::BritneySpears() : m_britney_spears(create_britney_spears(), free_britney_spears) { if (!m_britney_spears) { // Here I should throw something to abort the construction, but what ??! } } So the question is in the code sample: What should I throw to abort the constructor ? I know I can throw almost anything, but I want to know what is usually done. I have no other information about why the allocation failed. Should I create my own exception class ? Is there a std exception for such cases ? Many thanks.

    Read the article

  • How to implement event listener in background of the main program in java?

    - by Johny
    Hi im a beginner so sorry for my question if it sounds naive. I want to implement a thread that runs in the background and listens all the time. By listening i mean, say it keeps check on a value returned from main thread and if the vaue exceeds certain figure, it executes some method, or say exits the program. If you could give me some idea or at least refer me to something useful, that'll be great.

    Read the article

  • SQL Server 2008 Problem with SCOPE_IDENTITY()

    - by jinsungy
    My code does not update the thread field. It is null. Anyone have any ideas? INSERT INTO [Messages]([Sender], [Receiver], [Job_Number], [Subject], [MessageText], [DateSent]) VALUES(@Sender, @Receiver, @Job_Number, @Subject, @MessageText, @DateSent) SET @ThreadID = SCOPE_IDENTITY() UPDATE [Messages] SET Thread = @ThreadID WHERE MessageID = @ThreadID

    Read the article

  • stm monad problem

    - by Alex
    This is just a hypothetical scenario to illustrate my question. Suppose that there are two threads and one TVar shared between them. In one thread there is an atomically block that reads the TVar and takes 10s to complete. In another thread is an atomically block that modifies the TVar every second. Will the first atomically block ever complete? Surely it will just keep going back to the beginning, because the log is in an inconsistent state?

    Read the article

  • What is Apache process model?

    - by Morgan Cheng
    I have been googling this question for some time but got no answers. What's the Apache process model? By process model, I mean how Apache manage process or thread to handling HTTP request. Does it fork one process for each HTTP request? Does it have process/thread pool? Can we config it? Is there any online doc for such Apache details?

    Read the article

  • AudioTrack lag: obtainBuffer timed out

    - by BTR
    I'm playing WAVs on my Android phone by loading the file and feeding the bytes into AudioTrack.write() via the FileInputStream BufferedInputStream DataInputStream method. The audio plays fine and when it is, I can easily adjust sample rate, volume, etc on the fly with nice performance. However, it's taking about two full seconds for a track to start playing. I know AudioTrack has an inescapable delay, but this is ridiculous. Every time I play a track, I get this: 03-13 14:55:57.100: WARN/AudioTrack(3454): obtainBuffer timed out (is the CPU pegged?) 0x2e9348 user=00000960, server=00000000 03-13 14:55:57.340: WARN/AudioFlinger(72): write blocked for 233 msecs, 9 delayed writes, thread 0xba28 I've noticed that the delayed write count increases by one every time I play a track -- even across multiple sessions -- from the time the phone has been turned on. The block time is always 230 - 240ms, which makes sense considering a minimum buffer size of 9600 on this device (9600 / 44100). I've seen this message in countless searches on the Internet, but it usually seems to be related to not playing audio at all or skipping audio. In my case, it's just a delayed start. I'm running all my code in a high priority thread. Here's a truncated-yet-functional version of what I'm doing. This is the thread callback in my playback class. Again, this works (only playing 16-bit, 44.1kHz, stereo files right now), it just takes forever to start and has that obtainBuffer/delayed write message every time. public void run() { // Load file FileInputStream mFileInputStream; try { // mFile is instance of custom file class -- this is correct, // so don't sweat this line mFileInputStream = new FileInputStream(mFile.path()); } catch (FileNotFoundException e) {} BufferedInputStream mBufferedInputStream = new BufferedInputStream(mFileInputStream, mBufferLength); DataInputStream mDataInputStream = new DataInputStream(mBufferedInputStream); // Skip header try { if (mDataInputStream.available() > 44) mDataInputStream.skipBytes(44); } catch (IOException e) {} // Initialize device mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, ConfigManager.SAMPLE_RATE, AudioFormat.CHANNEL_CONFIGURATION_STEREO, AudioFormat.ENCODING_PCM_16BIT, ConfigManager.AUDIO_BUFFER_LENGTH, AudioTrack.MODE_STREAM); mAudioTrack.play(); // Initialize buffer byte[] mByteArray = new byte[mBufferLength]; int mBytesToWrite = 0; int mBytesWritten = 0; // Loop to keep thread running while (mRun) { // This flag is turned on when the user presses "play" while (mPlaying) { try { // Check if data is available if (mDataInputStream.available() > 0) { // Read data from file and write to audio device mBytesToWrite = mDataInputStream.read(mByteArray, 0, mBufferLength); mBytesWritten += mAudioTrack.write(mByteArray, 0, mBytesToWrite); } } catch (IOException e) { } } } } If I can get past the artificially long lag, I can easily deal with the inherit latency by starting my write at a later, predictable position (ie, skip past the minimum buffer length when I start playing a file).

    Read the article

  • Simple line matching using Regex

    - by Joan Venge
    I have this string stream: "do=whoposted&amp;t=1934067" rel=nofollow>61</A></TD><TD class=alt2 align=middle>5,286</TD></TR><TR><TD id=td_threadstatusicon_1911046 class=alt1><IMG id=thread_statusicon_1911046 border=0 alt="" src="http://url.com/forum/images/statusicon/thread_new.gif"> </TD><TD class=alt2><IMG title=Node border=0 alt=Node src="http://url.com/forum/images/icons/new.png"></TD><TD id=td_threadtitle_1911046 class=alt1 title="http://lulzimg.com/i14/7bd11b.jpg &#10; &#10;Complete name : cool-thread...."><DIV><A id=thread_gotonew_1911046 href="http://url.com/forum/f80/cool-topic-new/"><IMG class=inlineimg title="Go to first new post" border=0 alt="Go to first new post" src="http://url.com/forum/images/buttons/firstnew.gif"></A> [MULTI] <A style="FONT-WEIGHT: bold" id=thread_title_1911046 href="http://url.com/forum/f80/cool-topic-name-1911046/">Cool Topic Name</A> </DIV><DIV class=smallfont><SPAN style="CURSOR: pointer" onclick="window.open('http://url.com/forum/members/u2031889/', '_self')">m3no</SPAN> </DIV></TD><TD class=alt2 title="Replies: 11, Views: 1,554"><DIV style="TEXT-ALIGN: right; WHITE-SPACE: nowrap" class=smallfont>Today <SPAN class=time>08:04 AM</SPAN><BR>by <A href="http://url.com/forum/members/u1131830/" rel=nofollow>karetsos</A> <A " The lines I am interested are similar to this: <A style="FONT-WEIGHT: bold" id=thread_title_1911046 href="http://url.com/forum/f80/cool-topic-name-1911046/">Cool Topic Name</A> From here all I am trying to extract are: Thread id: 1911046 (could be from either location in the string) Thread name: "Cool Topic Name" Thread link: "http://url.com/forum/f80/cool-topic-name-1911046/" Currently I use this: Regex pattern = new Regex ( "<A\\s+href=\"([^\"]*)\">([^\\x00]*?)\\s+id=thread_title_(\\S+)</A>" ); MatchCollection matches = pattern.Matches ( doc.ToString ( ) ); foreach ( Match match in matches ) { int id = Convert.ToInt32 ( match.Groups [ 1 ].Value ); string name = match.Groups [ 3 ].Value; string link = match.Groups [ 2 ].Value; ... } I would appreciate if someone can help me fix the pattern to match it. This used to work but it returns 0 matches.

    Read the article

< Previous Page | 105 106 107 108 109 110 111 112 113 114 115 116  | Next Page >