Sponsored Content
Top Forums Programming Ideas Please (File Sequencing) Post 302145264 by bcpkvh on Tuesday 13th of November 2007 02:20:26 PM
Old 11-13-2007
Ideas Please (File Sequencing)

Hello All

Hope someone can help me with an idea or two on how to approach the following situation;

I currently have a process that generates sequenced files. The sequencing is very important and skipping sequences are not allowed. The applicaton has a single thread that consume data produced buy other threads in the application and this thread is dedicated to file generation and sequecing. When the application encounter a problem it does a rollback and exit. when it restarts it picks up where it left off and everything works fine.

We are starting to experience performance problems though, it simply can't keep up. We need to make the application scalable and I would like to do this by running multiple instances of the application.

My problem is sequencing the files. Everything will work fine so long as no exceptions are encountered, the multiple processes will share a memory area where the sequence will be maintained. But what if one process encounter a problem and exists? When it restart the shared sequence would be have been incremented multiple times.

Can someone suggest an elegant method of approaching this problem?

The application is written in C and is currenty running on TRU64 but will be moved to HPUX early next year.

Thank you,

B
 

9 More Discussions You Might Find Interesting

1. Programming

Ideas: 'select'ing file descriptors

Hey everyone, I'm writing a threaded database server application and need to communicate the results of several worker threads to a single multiplexed communication output thread. Basically, the communication output thread sits in a select statement waiting for its client sockets to dole out... (2 Replies)
Discussion started by: DreamWarrior
2 Replies

2. Cybersecurity

Any Ideas !!!!!!!!!!

Hi, I installed sybase server on a LINUX server. I assigen port 2025 whilst installation for sybase , later i uninstalled sybase and when i try to reinstall sybase and use port 2025 it throw up error saying that it is already in use, use other port number. How can I re-use the same port number... (2 Replies)
Discussion started by: suda
2 Replies

3. Shell Programming and Scripting

any ideas?

i need to compare to dates/times given in the format MMDDhhmmYY. That is month, day, hour, minute, year. It is a 24 hour clock. I need to compare two dates to check that they are, say, less than 900 seconds apart. I have got to a point where it checks the time, turns the values into seconds and... (5 Replies)
Discussion started by: fwabbly
5 Replies

4. Shell Programming and Scripting

Problem with Script that writes max lines of a file - Any ideas how to fix?

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (4 Replies)
Discussion started by: mmiller99
4 Replies

5. Shell Programming and Scripting

Sliding window for sequencing data

Hi! I have some sequencing data that I have aligned using maq software Now, I have data that looks like this each line is a 'tag' chr1 10001 chr1 10002 chr1 10005 chr1 10007 chr1 10008 chr1 10008 chr1 10008 chr1 10019 chr1 10019 chr1 10020 What I really want to find out is how... (1 Reply)
Discussion started by: biobio
1 Replies

6. Shell Programming and Scripting

Help generating a script for next-generation sequencing data

I am not sure if this is entirely possible, but I want to compare data in a particular column in several .txt files and have a new file generated. I am a biologist with limited unix knowledge. There are currently no programs written for this type of analysis. First I would like to define the... (1 Reply)
Discussion started by: kellywilliams
1 Replies

7. IP Networking

TCP Same Ack Sequencing for Two Packets

I was analyzing a TCP snoop. And found following scenario From Server to Client ---> SEQ 2993 ACK 1744 WIN 8192 LEN 13 From Server to Client ---> SEQ 3006 ACK 1744 WIN 8192 LEN 13 From Client to server --> SEQ 1744 ACK 3019 WIN 3304 I just want to know Why Packet 1 and 2... (3 Replies)
Discussion started by: mr_deb
3 Replies

8. UNIX and Linux Applications

Need ideas for graduation project based on unix or linux Need ideas for graduation project based on

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

9. Shell Programming and Scripting

Help me get some ideas

Hello, I have been given a scripting project, but have not learned any scripting. I need to get some ideas on how to start. Attached is part of the project: I have no idea how to parse the arguments. What I had in mind was to get the arguments ($1, $2, ... ) and have if statements for different... (1 Reply)
Discussion started by: facepalm
1 Replies
pthread_resume_np(3T)													     pthread_resume_np(3T)

NAME
pthread_resume_np(), pthread_continue(), pthread_suspend() - resume execution of a thread, continue execution of a thread, and suspend exe- cution of a thread SYNOPSIS
PARAMETERS
thread whose execution is to be suspended or resumed. flags Flags to be used by The valid values are: The target thread's suspension count is decremented by one. If the target thread was suspended and has a suspend count greater than one, the thread will not resume execution. The target thread's suspension count is set to zero. The target will resume execution even if its suspend count was greater than one. DESCRIPTION
The function suspends execution of the target thread specified by thread. The target thread may not be suspended immediately (at that exact instant). On successful return from the function, thread is no longer executing. Once a thread has been suspended, subsequent calls to the function increment a per thread suspension count and return immediately. Calling with the calling thread specified in thread is allowed. Note that in this case the calling thread shall be suspended during execu- tion of the function call and shall only return after another thread has called the or function for thread. The function resumes the execution of the target thread thread. If thread was suspended by multiple calls to only one call to is required to resume the execution of thread. Calling for a target thread that is not suspended shall have no effect and return no errors. Calling is equivalent to calling with the flags parameter specified as The function resumes the execution of the target thread specified by thread. If the flags argument is the target thread's suspension count is decremented by one. If the flags argument is the target thread's suspension count is set to zero. When the target thread's suspension count reaches zero, the target thread is allowed to continue execution. Calling for a target thread that is not suspended shall have no effect and return no errors. WARNING
This warning is applicable if any of the following conditions is true for a threaded application: a. The or environment variable is set to either or b. The application's binary is brought forward from a HP-UX 11i v1 release. In either of the above conditions, it is strongly recommended to set the environment variable to if the application uses which is not POSIX compliant. Failing to do so, can lead to undefined behavior. RETURN VALUE
If successful, and return zero. Otherwise, an error number shall be returned to indicate the error (the variable is not set). ERRORS
If any of the following occur, the function returns the corresponding error number. [ESRCH] The target thread thread is not in the current process. [EDEADLK] The target thread thread is the last running thread in the process. The operation would result in deadlock for the process. If any of the following occur, the and functions return the corresponding error number. [ESRCH] The target thread thread is not in the current process. [EINVAL] The value specified by flags is invalid. APPLICATION USAGE
This functionality enables a process that is multithreaded to temporarily suspend all activity to a single thread of control. When the process is single threaded, the address space is not changing, and a consistent view of the process can be gathered. One example of its use is for garbage collecting. The garbage collector runs asynchronously within the process and assumes that the process is not changing while it is running. Suspending a thread may have adverse effects on an application. If a thread is suspended while it holds a critical resource, such as a mutex or a read-write lock, the application may stop or even deadlock until the thread is continued. While the thread is suspended, other threads which may contend for the same resource must block until the thread is continued. Depending on application behavior, this may even result in deadlock. Application programmers are advised to either a) only suspend threads which call async-signal safe functions or b) ensure that the suspending thread does not contend for the same resources that the suspended thread may have acquired. Note: this includes resources that may be acquired by libraries. The and functions cannot reliably be used for thread synchronization. Synchronization primitives like mutexes, semaphores, read-write locks, and condition variables should be used instead. AUTHOR
and were developed by X/Open. was developed by HP. SEE ALSO
pthread_create(3T). STANDARDS CONFORMANCE
Pthread Library pthread_resume_np(3T)
All times are GMT -4. The time now is 01:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy